/* PDF Editor Styles */
.panel-section{background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}
.panel-section-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;cursor:pointer;user-select:none;border-bottom:1px solid transparent;transition:border-color .15s}
.panel-section-header:hover{background:rgba(0,0,0,.02)}
.panel-section-header h3{font-size:11px;font-weight:600;margin:0;color:#64748b;text-transform:uppercase;letter-spacing:.5px}
.panel-section-header .chevron{width:14px;height:14px;color:#94a3b8;transition:transform .2s}
.panel-section.open .panel-section-header{border-bottom-color:#e2e8f0}
.panel-section.open .panel-section-header .chevron{transform:rotate(180deg)}
.panel-section-body{padding:10px 12px;display:none}
.panel-section.open .panel-section-body{display:block}

.tool-btn{border:2px solid #e2e8f0;border-radius:8px;transition:all .15s;display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px;cursor:pointer;background:#fff;color:#64748b}
.tool-btn:hover{border-color:#93c5fd;color:#2563eb}
.tool-btn.active{border-color:#2563eb;background:#eff6ff;color:#2563eb}

/* Editor Workspace */
#editor-workspace{flex:1;display:flex;min-height:600px;overflow:hidden}
#editor-left{width:272px;min-width:240px;border-right:1px solid #e2e8f0;display:flex;flex-direction:column;overflow:hidden;flex-shrink:0;background:#fafbfc}
#editor-center{flex:1;display:flex;flex-direction:column;min-width:0;position:relative;overflow:hidden}
#editor-right{width:260px;min-width:220px;border-left:1px solid #e2e8f0;display:flex;flex-direction:column;overflow:hidden;flex-shrink:0;background:#fafbfc}
#editor-left-scroll, #editor-right-scroll{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px}

/* Preview Area */
#preview-area{flex:1;display:flex;flex-direction:column;background:#f1f5f9;overflow:hidden;min-height:0}
#preview-toolbar{display:flex;align-items:center;justify-content:space-between;padding:6px 12px;background:#fff;border-bottom:1px solid #e2e8f0;flex-shrink:0}
.preview-toolbar-group{display:flex;align-items:center;gap:4px}
.tb-btn{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border:1px solid #e2e8f0;background:#fff;border-radius:6px;cursor:pointer;color:#64748b;font-size:14px;transition:all .15s}
.tb-btn:hover{border-color:#93c5fd;color:#2563eb}
.tb-btn:disabled{opacity:.4;cursor:default;pointer-events:none}
.tb-label{font-size:11px;font-weight:500;color:#374151;font-family:'JetBrains Mono',monospace;min-width:36px;text-align:center}
.tb-page-label{font-size:11px;color:#94a3b8;font-weight:500;min-width:50px;text-align:center}
.tb-btn-wide{height:28px;display:flex;align-items:center;justify-content:center;border:1px solid #e2e8f0;background:#fff;border-radius:6px;cursor:pointer;color:#64748b;font-size:10px;padding:0 8px;transition:all .15s}
.tb-btn-wide:hover{border-color:#93c5fd;color:#2563eb}

#preview-canvas-wrap{flex:1;display:flex;align-items:center;justify-content:center;overflow:auto;padding:16px;position:relative;min-height:0}
#preview-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#94a3b8;text-align:center;padding:40px;gap:8px}
#preview-empty svg{color:#cbd5e1}
#canvas-stage{position:relative;display:inline-block;line-height:0;display:none}
#preview-canvas{border-radius:2px;box-shadow:0 2px 12px rgba(0,0,0,.1);max-width:100%;height:auto}
#elements-stage{position:absolute;top:0;left:0;width:100%;height:100%}

/* Export Bar */
#export-bar{display:flex;gap:8px;padding:10px 16px;border-top:1px solid #e2e8f0;background:#fff;flex-shrink:0}
.btn-apply{flex:1;padding:9px 16px;background:#2563eb;color:#fff;border:none;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:all .15s}
.btn-apply:hover:not(:disabled){background:#1d4ed8}
.btn-apply:disabled{opacity:.5;cursor:default}
.btn-reset{padding:9px 14px;background:#fff;color:#64748b;border:1px solid #e2e8f0;border-radius:8px;font-size:12px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:all .15s}
.btn-reset:hover{background:#f1f5f9;border-color:#cbd5e1}

/* Progress & Result */
#progress-section{display:none;position:absolute;bottom:0;left:0;right:0;background:rgba(255,255,255,.95);padding:14px;border-top:1px solid #e2e8f0;z-index:10}
.progress-top{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.progress-spinner{width:16px;height:16px;border:3px solid #e2e8f0;border-top-color:#2563eb;border-radius:50%;animation:pdfed-spin .6s linear infinite;flex-shrink:0}
@keyframes pdfed-spin{to{transform:rotate(360deg)}}
.progress-phase{font-size:12px;font-weight:500;color:#0f172a;flex:1}
.progress-pct{font-size:12px;font-weight:600;color:#2563eb;font-family:'JetBrains Mono',monospace}
.progress-track{height:5px;background:#e2e8f0;border-radius:9999px;overflow:hidden}
.progress-fill{height:100%;background:linear-gradient(90deg,#2563eb,#7c3aed);border-radius:9999px;transition:width .3s;width:0}

#result-overlay{display:none;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(241,245,249,.97);z-index:15;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.result-icon{width:44px;height:44px;border-radius:50%;background:#dcfce7;display:flex;align-items:center;justify-content:center}
.result-title{font-size:15px;font-weight:600;color:#0f172a;margin:0}
.result-info{font-size:12px;color:#64748b;margin:0}
.result-actions{display:flex;gap:6px;margin-top:4px}
.btn-download{padding:9px 18px;background:#16a34a;color:#fff;border:none;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:all .15s}
.btn-download:hover{background:#15803d}
.btn-new{padding:9px 14px;background:#fff;color:#2563eb;border:1px solid #2563eb;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;transition:all .15s}
.btn-new:hover{background:#eff6ff}

/* Properties Panel */
.props-empty{font-size:11px;color:#94a3b8;text-align:center;padding:8px 0}
.prop-row{display:flex;align-items:center;gap:8px;margin-bottom:6px;font-size:11px}
.prop-row label{width:48px;font-weight:500;color:#64748b;flex-shrink:0}
.prop-row-col{flex-direction:column;align-items:stretch}
.prop-label-full{width:auto;margin-bottom:4px}
.prop-input{width:60px;padding:4px 6px;border:1px solid #e2e8f0;border-radius:5px;font-size:11px;text-align:center;font-family:'JetBrains Mono',monospace}
.prop-input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.15)}
.prop-range{flex:1;height:4px;accent-color:#2563eb}
.range-val{font-size:10px;color:#94a3b8;min-width:30px;text-align:right;font-family:'JetBrains Mono',monospace}
.prop-color{width:32px;height:28px;padding:0;border:1px solid #e2e8f0;border-radius:4px;cursor:pointer}
.prop-textarea{font-size:11px;padding:6px 8px;border:1px solid #e2e8f0;border-radius:6px;resize:vertical;width:100%;box-sizing:border-box}
.prop-textarea:focus{outline:none;border-color:#2563eb}
.prop-actions{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid #e2e8f0}
.prop-btn{padding:5px 8px;font-size:10px;font-weight:600;border:1px solid #e2e8f0;background:#fff;border-radius:6px;cursor:pointer;color:#64748b;transition:all .12s}
.prop-btn:hover{background:#f1f5f9;border-color:#cbd5e1;color:#0f172a}
.prop-btn.danger{color:#ef4444;border-color:#fecaca}
.prop-btn.danger:hover{background:#fef2f2;border-color:#fca5a5}

/* Highlight swatches */
.prop-row-swatches{flex-wrap:wrap;gap:4px}
.swatch{width:20px;height:20px;border-radius:4px;border:2px solid transparent;cursor:pointer;transition:all .1s}
.swatch:hover{transform:scale(1.15)}
.prop-swatch-active{border-color:#2563eb;transform:scale(1.15)}

/* Elements List */
.el-empty{font-size:11px;color:#94a3b8;text-align:center;padding:12px}
.el-list-item{display:flex;align-items:center;gap:4px;padding:6px 8px;border:1px solid transparent;border-radius:6px;cursor:pointer;transition:all .12s;font-size:11px}
.el-list-item:hover{background:#f1f5f9}
.el-type-badge{font-size:10px;font-weight:600;color:#64748b;text-transform:uppercase;min-width:40px}
.el-label{font-size:10px;color:#94a3b8;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.el-icon{color:#94a3b8}

/* Header */
.gt-card-header{padding:14px 20px}
.gt-card-divider{height:1px;background:#e2e8f0;margin:0}
.gt-upload-area{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:14px 10px;border:2px dashed #e2e8f0;border-radius:8px;background:#f8fafc;cursor:pointer;transition:border-color .2s,background .2s;text-align:center}
.gt-upload-area:hover{border-color:#2563eb;background:rgba(37,99,235,.04)}
.gt-upload-area.dragover{border-color:#2563eb;background:rgba(37,99,235,.08);box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.gt-upload-icon{width:22px;height:22px;color:#2563eb}
.gt-upload-btn{padding:4px 10px;font-size:10px;background:#fff;border:1px solid #e2e8f0;border-radius:6px;cursor:pointer;font-weight:500;color:#0f172a;transition:all .15s}
.gt-upload-btn:hover{border-color:#2563eb;color:#2563eb}

/* Tool Grid */
#tool-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}

/* Panel Section */
#elements-list{display:flex;flex-direction:column;gap:3px;max-height:180px;overflow-y:auto}

/* Status Badge */
.status-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border:1px solid #e2e8f0;border-radius:9999px;font-size:11px;font-weight:500;transition:all .15s}

/* Notifications */
.notification{position:fixed;top:20px;left:50%;transform:translateX(-50%);padding:12px 24px;background:#0f172a;color:#fff;border-radius:8px;font-size:13px;font-weight:500;z-index:9999;box-shadow:0 4px 12px rgba(0,0,0,.15);animation:pdfed-slide .3s ease}
.notification.error{background:#dc2626}
@keyframes pdfed-slide{from{opacity:0;transform:translateX(-50%) translateY(-10px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}

/* ── RESPONSIVE ── */

/* Tablet Landscape */
@media(max-width:1024px){
    #editor-left{width:240px;min-width:200px}
    #editor-right{width:240px;min-width:200px}
}

/* Tablet Portrait */
@media(max-width:900px){
    #editor-workspace{flex-direction:column;min-height:auto;overflow:visible}
    #editor-left,#editor-right{width:100%;min-width:0;border:none;border-bottom:1px solid #e2e8f0;max-height:200px}
    #editor-left{border-right:none;border-top:none}
    #editor-right{border-top:1px solid #e2e8f0;border-bottom:none;max-height:220px}
    #editor-center{overflow:visible}
    #preview-area{min-height:350px;flex:1;overflow:visible}
    #elements-list{max-height:120px}
    #editor-left-scroll,#editor-right-scroll{padding:8px}
}

/* Mobile Landscape */
@media(max-width:768px){
    #editor-left,#editor-right{max-height:180px}
    #preview-area{min-height:300px}
    .tool-btn{padding:7px 2px}
    .tool-btn svg{width:16px;height:16px}
    .tool-btn span{font-size:8px}
    #tool-grid{gap:4px}
    .tb-btn{width:30px;height:30px}
    .tb-btn-wide{padding:0 8px;font-size:10px}
    #export-bar{padding:6px 10px}
    .btn-apply,.btn-reset{font-size:11px;padding:7px 12px}
    .hero h1{font-size:24px!important}
    .hero p{font-size:13px!important}
}

/* Mobile Portrait */
@media(max-width:480px){
    #editor-workspace{overflow:visible;max-height:none}
    #editor-left,#editor-right{max-height:none}
    #editor-left-scroll,#editor-right-scroll{padding:6px}
    #editor-center{overflow:visible}
    #preview-area{min-height:260px;overflow:visible}
    #preview-canvas-wrap{padding:6px}
    #tool-grid{grid-template-columns:repeat(4,1fr);gap:3px}
    .tool-btn{padding:5px 2px}
    .tool-btn svg{width:14px;height:14px}
    .tool-btn span{font-size:7px;letter-spacing:0}
    .panel-section-header{padding:6px 8px}
    .panel-section-body{padding:6px 8px}
    .prop-row{gap:4px;font-size:10px}
    .prop-input{width:50px;font-size:10px}
    .tb-btn{width:28px;height:28px;font-size:12px}
    .hero h1{font-size:20px!important}
    .hero p{font-size:12px!important}
    .hero .trust-badge{font-size:10px}
}

/* Reduced Motion */
@media(prefers-reduced-motion:reduce){
    *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}