/* glulando — Visual Page Builder CSS v1.7 */
/* Complete Dark Mode for entire canvas stage */

/* ─── 3-Panel Layout ─── */
.builder-wrap{display:flex;height:calc(100vh - 49px);overflow:hidden;background:#f3f4f6}
.builder-toolbar{display:flex;align-items:center;gap:8px;padding:6px 12px;background:#fff;border-bottom:1px solid #e5e7eb;flex-shrink:0;height:49px}
.builder-toolbar .btn-group{display:flex;gap:2px}
.builder-toolbar button,.builder-toolbar a.btn{padding:5px 10px;border:1px solid #d1d5db;border-radius:6px;background:#fff;cursor:pointer;font-size:13px;display:flex;align-items:center;gap:4px;text-decoration:none;color:#374151}
.builder-toolbar button:hover,.builder-toolbar a.btn:hover{background:#f9fafb}
.builder-toolbar button.active{background:#1e40af;color:#fff;border-color:#1e40af}
.builder-toolbar .b-title{font-weight:600;font-size:15px;margin-right:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}
.builder-toolbar .b-status{font-size:11px;color:#9ca3af;margin-right:8px}

/* Sidebar */
#builder-sidebar{width:200px;background:#fff;border-right:1px solid #e5e7eb;overflow-y:auto;flex-shrink:0;transition:box-shadow .3s}
.b-sb-header{padding:10px 12px;font-weight:600;border-bottom:1px solid #f3f4f6}
.b-sb-header h3{font-size:13px;margin:0}
.b-sb-search{position:relative;padding:6px 10px}
.b-sb-search input{width:100%;padding:6px 8px 6px 28px;border:1px solid #e5e7eb;border-radius:6px;font-size:12px}
.b-sb-search i{position:absolute;left:18px;top:50%;transform:translateY(-50%);color:#9ca3af;font-size:11px}
.b-sb-cat-label{font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:#6b7280;padding:6px 10px 2px;font-weight:600}
.b-sb-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:2px 10px 10px}
.b-sb-item{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;border:1px solid #e5e7eb;border-radius:6px;cursor:grab;font-size:10px;text-align:center;transition:all .15s}
.b-sb-item:hover{border-color:#3b82f6;background:#eff6ff}
.b-sb-item i{font-size:16px;color:#6b7280}
.b-sb-item:hover i{color:#3b82f6}
@keyframes sbPulse{0%{box-shadow:0 0 0 0 rgba(59,130,246,.4)}50%{box-shadow:0 0 0 6px rgba(59,130,246,.15)}100%{box-shadow:0 0 0 0 rgba(59,130,246,0)}}
#builder-sidebar.b-sb-highlight{animation:sbPulse .6s ease 2;border-right-color:#3b82f6}
.b-dnd-ind{height:3px;background:#3b82f6;border-radius:2px;margin:2px 0;pointer-events:none}

/* Canvas */
#builder-canvas{flex:1;overflow-y:auto;padding:16px;min-width:0;transition:max-width .3s}
.builder-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:300px;border:2px dashed #d1d5db;border-radius:12px;color:#9ca3af;cursor:pointer;gap:8px;font-size:14px}
.builder-empty:hover{border-color:#3b82f6;color:#3b82f6}
.builder-empty i{font-size:32px}

/* Sections */
.b-section{background:#fff;border-radius:8px;margin-bottom:12px;border:1px solid #e5e7eb;position:relative;transition:box-shadow .2s}
.b-section:hover{box-shadow:0 2px 8px rgba(0,0,0,.06)}
.b-section.b-dragging{opacity:.5}
.b-section.b-sec-over{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.3)}
.b-sec-bar{display:flex;align-items:center;gap:6px;padding:4px 10px;background:#f9fafb;border-bottom:1px solid #f3f4f6;border-radius:8px 8px 0 0;font-size:11px}
.b-sec-drag{cursor:grab;color:#9ca3af}
.b-sec-label{color:#6b7280;font-weight:500}
.b-sec-actions{margin-left:auto;display:flex;gap:1px}
.b-sec-actions button{border:none;background:none;cursor:pointer;padding:3px 5px;border-radius:4px;color:#9ca3af;font-size:11px}
.b-sec-actions button:hover{background:#e5e7eb;color:#374151}

/* Columns & Elements */
.b-columns{display:grid;gap:10px;padding:12px}
.b-column{min-height:50px;border:1px dashed #e5e7eb;border-radius:6px;padding:4px;transition:all .2s}
.b-column.b-col-over{border-color:#3b82f6;background:rgba(59,130,246,.04)}
.b-element{position:relative;border:1px solid transparent;border-radius:6px;cursor:pointer;transition:all .15s;margin-bottom:4px}
.b-element:hover{border-color:#d1d5db}
.b-element.b-el-selected{border-color:#3b82f6;box-shadow:0 0 0 2px rgba(59,130,246,.2)}
.b-element.b-dragging{opacity:.4}
.b-el-content{padding:6px 8px}
.b-el-bar{display:none;position:absolute;top:-26px;left:0;background:#1e40af;border-radius:4px;padding:2px 4px;gap:1px;align-items:center;z-index:5;white-space:nowrap}
.b-element:hover .b-el-bar,.b-element.b-el-selected .b-el-bar{display:flex}
.b-el-bar span,.b-el-bar button{color:#fff;font-size:10px;border:none;background:none;cursor:pointer;padding:2px 3px}
.b-el-bar button:hover{background:rgba(255,255,255,.2);border-radius:3px}
.b-el-drag{cursor:grab}
.b-el-type{opacity:.7;font-size:9px;margin-right:3px}
.b-add-el{display:flex;align-items:center;justify-content:center;gap:4px;padding:8px;border:1px dashed #d1d5db;border-radius:6px;color:#9ca3af;cursor:pointer;margin-top:4px;font-size:12px}
.b-add-el:hover{border-color:#3b82f6;color:#3b82f6}
.b-add-section{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;border:2px dashed #d1d5db;border-radius:8px;color:#9ca3af;cursor:pointer;font-size:13px}
.b-add-section:hover{border-color:#3b82f6;color:#3b82f6}

/* ─── Settings Panel ─── */
#builder-settings{width:260px;background:#fff;border-left:1px solid #e5e7eb;overflow-y:auto;flex-shrink:0;display:flex;flex-direction:column}
.b-set-header{padding:12px 14px;font-weight:600;font-size:13px;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;align-items:center;gap:8px;background:#f9fafb;flex-shrink:0}
.b-set-header i{margin-right:6px;color:#6b7280;font-size:12px}
.b-set-header button{border:none;background:none;cursor:pointer;color:#9ca3af;font-size:14px;padding:2px}
.b-set-header button:hover{color:#374151}
.b-set-body{padding:14px;flex:1;overflow-y:auto}
.b-set-group{margin-bottom:14px}
.b-set-group label{display:block;font-size:11px;font-weight:600;color:#374151;margin-bottom:5px;letter-spacing:.02em}
.b-set-group input[type="text"],.b-set-group input[type="number"],.b-set-group select,.b-set-group textarea{width:100%;padding:8px 10px;border:1px solid #e5e7eb;border-radius:8px;font-size:12px;background:#fff;transition:border-color .15s;outline:none;color:#1f2937}
.b-set-group input:focus,.b-set-group select:focus,.b-set-group textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}
.b-set-group textarea{min-height:60px;resize:vertical;font-family:inherit}
.b-set-group input[type="color"]{width:100%;height:36px;padding:3px;cursor:pointer;border:1px solid #e5e7eb;border-radius:8px;background:#fff}
.b-set-group input[type="range"]{width:100%;accent-color:#3b82f6}
.b-set-group input[type="file"]{font-size:11px;padding:6px;border:1px dashed #d1d5db;border-radius:8px;background:#f9fafb;cursor:pointer;width:100%}
.b-set-group input[type="file"]:hover{border-color:#3b82f6;background:#eff6ff}
.b-set-hint{font-size:11px;color:#9ca3af;font-style:italic}
.b-set-btn{display:flex;align-items:center;gap:6px;width:100%;padding:8px 12px;border:1px solid #e5e7eb;border-radius:8px;background:#f9fafb;cursor:pointer;font-size:12px;color:#374151;transition:all .15s}
.b-set-btn:hover{background:#eff6ff;border-color:#3b82f6;color:#1d4ed8}
.b-set-btn i{font-size:12px;color:#6b7280}
.b-set-btn:hover i{color:#3b82f6}
.b-set-btn-sm{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border:1px dashed #d1d5db;border-radius:6px;background:none;cursor:pointer;font-size:11px;color:#6b7280;margin-top:6px;transition:all .15s}
.b-set-btn-sm:hover{border-color:#3b82f6;color:#3b82f6;background:#eff6ff}
.b-set-sizes{display:flex;gap:2px}
.b-sz-btn{padding:6px 10px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;cursor:pointer;font-size:12px;color:#6b7280;transition:all .15s}
.b-sz-btn:hover{border-color:#3b82f6;color:#3b82f6}
.b-sz-btn.active{background:#1e40af;color:#fff;border-color:#1e40af}
.b-preset-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px}
.b-preset-btn{padding:6px 4px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;cursor:pointer;font-size:10px;color:#6b7280;transition:all .15s;text-align:center}
.b-preset-btn:hover{border-color:#3b82f6;color:#3b82f6;background:#eff6ff}
.b-set-align{display:flex;gap:2px;border:1px solid #e5e7eb;border-radius:8px;overflow:hidden}
.b-set-align button{flex:1;padding:6px;border:none;background:#fff;cursor:pointer;font-size:12px;color:#6b7280;transition:all .15s}
.b-set-align button:hover{background:#f3f4f6}
.b-set-align button.active{background:#1e40af;color:#fff}

/* List & FAQ Editor */
.b-list-row{display:flex;gap:4px;margin-bottom:4px;align-items:center}
.b-list-row input{flex:1;padding:6px 8px;border:1px solid #e5e7eb;border-radius:6px;font-size:12px;color:#1f2937}
.b-list-row input:focus{border-color:#3b82f6;outline:none;box-shadow:0 0 0 2px rgba(59,130,246,.1)}
.b-list-row button{width:28px;height:28px;border:none;background:#fef2f2;color:#ef4444;border-radius:6px;cursor:pointer;font-size:11px;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s}
.b-list-row button:hover{background:#ef4444;color:#fff}
.b-faq-row{padding:10px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:6px;background:#f9fafb;position:relative}
.b-faq-row input{width:100%;padding:6px 8px;border:1px solid #e5e7eb;border-radius:6px;font-size:12px;margin-bottom:4px;font-weight:600;color:#1f2937;background:#fff}
.b-faq-row textarea{width:100%;padding:6px 8px;border:1px solid #e5e7eb;border-radius:6px;font-size:12px;resize:vertical;min-height:40px;color:#1f2937;background:#fff}
.b-faq-row input:focus,.b-faq-row textarea:focus{border-color:#3b82f6;outline:none;box-shadow:0 0 0 2px rgba(59,130,246,.1)}
.b-faq-row button{position:absolute;top:8px;right:8px;width:24px;height:24px;border:none;background:#fef2f2;color:#ef4444;border-radius:6px;cursor:pointer;font-size:10px;display:flex;align-items:center;justify-content:center}
.b-faq-row button:hover{background:#ef4444;color:#fff}

/* Layout Modal */
#builder-layout-modal{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:100;display:flex;align-items:center;justify-content:center}
#builder-layout-modal.hidden{display:none}
#builder-layout-modal .b-modal-body{background:#fff;border-radius:12px;padding:20px;max-width:400px;width:90%}
.b-layout-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px}
.b-layout-opt{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 6px;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;background:#fff;font-size:10px}
.b-layout-opt:hover{border-color:#3b82f6;background:#eff6ff}
.b-layout-preview{display:flex;gap:2px;width:100%;height:20px}
.b-layout-preview span{background:#3b82f6;border-radius:2px;opacity:.3}
.b-layout-opt:hover .b-layout-preview span{opacity:.6}
.b-preview-btn{padding:4px 8px!important;font-size:12px!important}

/* Mobile */
#builder-mobile-sheet{position:fixed;bottom:0;left:0;right:0;background:#fff;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px rgba(0,0,0,.15);transform:translateY(100%);transition:transform .3s;z-index:50;max-height:60vh;overflow-y:auto}
#builder-mobile-sheet.open{transform:translateY(0)}
.b-sheet-handle{width:40px;height:4px;background:#d1d5db;border-radius:2px;margin:8px auto}
.b-sheet-body{padding:12px 16px 24px}

/* ─── Responsive ─── */
@media(max-width:768px){
    .builder-wrap{flex-direction:column;height:auto;min-height:100vh}
    #builder-sidebar{display:none}
    #builder-settings{width:100%;position:fixed;bottom:0;left:0;right:0;max-height:50vh;border-top:1px solid #e5e7eb;border-left:none;z-index:40;transform:translateY(100%);transition:transform .3s;border-radius:16px 16px 0 0}
    #builder-settings.open{transform:translateY(0)}
    #builder-canvas{padding:8px}
    .builder-toolbar{flex-wrap:wrap;gap:4px;padding:4px 8px}
    .builder-toolbar .b-title{max-width:100px;font-size:12px}
    .b-columns{padding:6px}
    .b-layout-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:480px){
    .builder-toolbar button span{display:none}
    .b-sb-grid{grid-template-columns:repeat(3,1fr)}
}

/* ══════════════════════════════════════════════════
   DARK MODE — Complete v1.7
   Uses !important to override inline styles set by JS
   ══════════════════════════════════════════════════ */

/* --- Layout Shell --- */
body.dark .builder-wrap{background:#0f172a}
body.dark #builder-sidebar,body.dark #builder-settings,body.dark .builder-toolbar{background:#1e293b;border-color:#334155}
body.dark .builder-toolbar button,body.dark .builder-toolbar a.btn{background:#0f172a;border-color:#334155;color:#cbd5e1}
body.dark .builder-toolbar button:hover,body.dark .builder-toolbar a.btn:hover{background:#1e3a5f}
body.dark .builder-toolbar .b-title{color:#e2e8f0}
body.dark .builder-toolbar .b-status{color:#64748b}

/* --- Sidebar --- */
body.dark .b-sb-header{border-color:#334155;color:#e2e8f0}
body.dark .b-sb-item{border-color:#334155;color:#cbd5e1}
body.dark .b-sb-item:hover{background:#1e3a5f;border-color:#3b82f6}
body.dark .b-sb-item i{color:#94a3b8}
body.dark .b-sb-cat-label{color:#94a3b8}
body.dark .b-sb-search input{background:#0f172a;border-color:#334155;color:#e2e8f0}

/* --- Canvas Stage (critical: !important to override inline bg) --- */
body.dark #builder-canvas{background:#0f172a}
body.dark .b-section{background:#1e293b!important;border-color:#334155}
body.dark .b-section:hover{box-shadow:0 2px 8px rgba(0,0,0,.3)}
body.dark .b-sec-bar{background:#0f172a!important;border-color:#334155}
body.dark .b-sec-label{color:#94a3b8}
body.dark .b-sec-drag{color:#64748b}
body.dark .b-sec-actions button{color:#64748b}
body.dark .b-sec-actions button:hover{background:#334155;color:#e2e8f0}
body.dark .b-column{border-color:#334155}
body.dark .b-element:hover{border-color:#475569}
body.dark .b-add-el{border-color:#334155;color:#64748b}
body.dark .b-add-el:hover{border-color:#3b82f6;color:#3b82f6}
body.dark .b-add-section{border-color:#334155;color:#64748b}
body.dark .b-add-section:hover{border-color:#3b82f6;color:#3b82f6}
body.dark .builder-empty{border-color:#334155;color:#64748b}

/* --- Canvas: Element Preview Inline-Style Overrides --- */
body.dark .b-el-content details{background:#0f172a!important;border-color:#334155!important;box-shadow:0 1px 3px rgba(0,0,0,.4)!important}
body.dark .b-el-content details summary{color:#e2e8f0!important}
body.dark .b-el-content details summary>span{color:#e2e8f0!important}
body.dark .b-el-content details>p{color:#94a3b8!important;border-color:#334155!important}
body.dark .b-el-content details>div{color:#94a3b8!important}

/* Testimonial, PriceBox, generic bg overrides */
body.dark .b-el-content>div[style*="background"]{background:#1e293b!important;border-color:#334155!important}
body.dark .b-el-content>div[style*="border:2px solid"]{border-color:#334155!important}
body.dark .b-el-content>div[style*="border:2px dashed"]{border-color:#475569!important;color:#64748b!important}
body.dark .b-el-content>div[style*="border:1px solid"]{border-color:#334155!important}

/* Headings & text inside canvas */
body.dark .b-el-content h1,body.dark .b-el-content h2,body.dark .b-el-content h3,body.dark .b-el-content h4{color:#e2e8f0!important}
body.dark .b-el-content>div[contenteditable]{color:#e2e8f0!important}
body.dark .b-el-content p{color:#cbd5e1!important}

/* Lists */
body.dark .b-el-content ul{color:#e2e8f0}
body.dark .b-el-content li{color:#e2e8f0!important}
body.dark .b-el-content li span{color:#e2e8f0!important}

/* PriceBox inner elements */
body.dark .b-el-content div[style*="font-size:42px"]{color:#e2e8f0!important}
body.dark .b-el-content div[style*="font-size:13px"]{color:#94a3b8!important}
body.dark .b-el-content li[style*="border-bottom"]{border-color:#334155!important;color:#e2e8f0!important}

/* Spacer */
body.dark .b-el-content>div[style*="repeating-linear-gradient"]{color:#475569!important}

/* HTML block */
body.dark .b-el-content>div[style*="monospace"]{background:#0f172a!important;color:#94a3b8!important}

/* Image placeholder */
body.dark .b-el-content>div[style*="dashed"]>i{color:#475569!important}
body.dark .b-el-content>div[style*="dashed"]>span{color:#64748b!important}

/* Video placeholder */
body.dark .b-el-content>div[style*="dashed"]{background:#0f172a!important;border-color:#475569!important;color:#64748b!important}

/* --- Settings Panel --- */
body.dark .b-set-header{background:#0f172a;border-color:#334155;color:#e2e8f0}
body.dark .b-set-header i{color:#94a3b8}
body.dark .b-set-header button{color:#64748b}
body.dark .b-set-header button:hover{color:#e2e8f0}
body.dark .b-set-group label{color:#94a3b8}
body.dark .b-set-group input[type="text"],body.dark .b-set-group input[type="number"],body.dark .b-set-group select,body.dark .b-set-group textarea{background:#0f172a;border-color:#334155;color:#e2e8f0}
body.dark .b-set-group input[type="color"]{background:#0f172a;border-color:#334155}
body.dark .b-set-group input[type="file"]{background:#0f172a;border-color:#334155;color:#94a3b8}
body.dark .b-set-btn{background:#0f172a;border-color:#334155;color:#e2e8f0}
body.dark .b-set-btn-sm{color:#94a3b8;border-color:#334155}
body.dark .b-set-btn-sm:hover{background:#1e3a5f;border-color:#3b82f6;color:#93c5fd}
body.dark .b-set-align button{background:#0f172a;color:#94a3b8}
body.dark .b-set-align button.active{background:#1e40af;color:#fff}
body.dark .b-sz-btn{background:#0f172a;border-color:#334155;color:#94a3b8}
body.dark .b-sz-btn.active{background:#1e40af;color:#fff;border-color:#1e40af}
body.dark .b-preset-btn{background:#0f172a;border-color:#334155;color:#94a3b8}
body.dark .b-preset-btn:hover{background:#1e3a5f;border-color:#3b82f6;color:#93c5fd}

/* Settings: List & FAQ editors */
body.dark .b-list-row input{background:#0f172a;border-color:#334155;color:#e2e8f0}
body.dark .b-list-row button{background:#3b1919;color:#f87171}
body.dark .b-list-row button:hover{background:#ef4444;color:#fff}
body.dark .b-faq-row{background:#0f172a;border-color:#334155}
body.dark .b-faq-row input{background:#1e293b;border-color:#334155;color:#e2e8f0}
body.dark .b-faq-row textarea{background:#1e293b;border-color:#334155;color:#e2e8f0}
body.dark .b-faq-row button{background:#3b1919;color:#f87171}
body.dark .b-faq-row button:hover{background:#ef4444;color:#fff}

/* Modals */
body.dark #builder-layout-modal .b-modal-body{background:#1e293b;color:#e2e8f0}
body.dark .b-layout-opt{background:#0f172a;border-color:#334155;color:#cbd5e1}
body.dark #builder-mobile-sheet{background:#1e293b}
