.designer-placeholder{
    padding:40px;
    text-align:center;
    color:#999;
    border:2px dashed #ccc;
    border-radius:8px;
}

.designer-card{
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px;
    margin-bottom:10px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:8px;
    cursor:pointer;
}

.designer-card.selected{
    border-color:#2563eb;
    background:#eff6ff;
}

.dragHandle{
    cursor:move;
    font-size:20px;
    color:#777;
}

.designer-info{
    flex:1;
}

.designer-title{
    font-weight:600;
}

.designer-sub{
    font-size:12px;
    color:#666;
}

.designer-type{
    background:#2563eb;
    color:#fff;
    padding:3px 10px;
    border-radius:12px;
    font-size:12px;
}

.designer-actions{
    display:flex;
    gap:6px;
}

.designer-actions button{
    width:30px;
    height:30px;
    padding:0;
}

.property-form{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.form-group{
    display:flex;
    flex-direction:column;
}

.form-group label{
    font-weight:600;
    margin-bottom:6px;
}

.form-group input,
.form-group textarea,
.form-group select{
    padding:8px 10px;
    border:1px solid #d1d5db;
    border-radius:6px;
}

.grid2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}

.check{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:14px;
}


/* ==========================================================
   Apify Input Schema Builder
   style.css
   Part 1
========================================================== */

:root{

    --primary:#2563eb;
    --primary-dark:#1d4ed8;

    --success:#16a34a;
    --danger:#dc2626;
    --warning:#f59e0b;

    --border:#dcdfe6;
    --panel:#ffffff;

    --background:#f5f7fb;

    --text:#1f2937;
    --text-light:#6b7280;

    --radius:10px;

    --shadow:
        0 2px 10px rgba(0,0,0,.08);

    --transition:.20s;
}

*{

    margin:0;
    padding:0;
    box-sizing:border-box;

}

html,
body{

    width:100%;
    height:100%;

    font-family:

        "Segoe UI",
        Arial,
        sans-serif;

    background:var(--background);

    color:var(--text);

}

/* ==========================================================
   APP
========================================================== */

.app{

    display:flex;

    flex-direction:column;

    height:100vh;

    overflow:hidden;

}

/* ==========================================================
   HEADER
========================================================== */

.topbar{

    height:70px;

    background:white;

    border-bottom:1px solid var(--border);

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:0 20px;

    box-shadow:var(--shadow);

    z-index:100;

}

.logo{

    display:flex;

    align-items:center;

    gap:15px;

}

.logo-icon{

    width:44px;

    height:44px;

    border-radius:12px;

    background:var(--primary);

    color:white;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:24px;

}

.logo h1{

    font-size:22px;

    font-weight:700;

}

.logo span{

    font-size:13px;

    color:var(--text-light);

}

/* ==========================================================
   TOOLBAR
========================================================== */

.toolbar{

    display:flex;

    align-items:center;

    gap:10px;

}

.toolbar button{

    border:none;

    outline:none;

    cursor:pointer;

    padding:10px 18px;

    border-radius:8px;

    background:var(--primary);

    color:white;

    font-size:14px;

    transition:var(--transition);

}

.toolbar button:hover{

    background:var(--primary-dark);

    transform:translateY(-1px);

}

.toolbar button:active{

    transform:scale(.98);

}

/* ==========================================================
   WORKSPACE
========================================================== */

.workspace{

    flex:1;

    display:grid;

    grid-template-columns:

        280px
        1fr
        340px;

    gap:16px;

    padding:16px;

    overflow:hidden;

}

/* ==========================================================
   PANELS
========================================================== */

.toolbox,
.designer,
.properties{

    background:var(--panel);

    border:1px solid var(--border);

    border-radius:var(--radius);

    box-shadow:var(--shadow);

    display:flex;

    flex-direction:column;

    overflow:hidden;

}

.panel-title{

    padding:15px 18px;

    font-size:16px;

    font-weight:600;

    border-bottom:1px solid var(--border);

    background:#fafafa;

}

/* ==========================================================
   SEARCH
========================================================== */

.toolbox-search{

    padding:15px;

    border-bottom:1px solid var(--border);

}

.toolbox-search input{

    width:100%;

    padding:10px 12px;

    border:1px solid var(--border);

    border-radius:8px;

    outline:none;

    font-size:14px;

}

.toolbox-search input:focus{

    border-color:var(--primary);

}

/* ==========================================================
   SCROLLBARS
========================================================== */

.toolbox,
.designer,
.properties{

    overflow:auto;

}

.toolbox::-webkit-scrollbar,
.designer::-webkit-scrollbar,
.properties::-webkit-scrollbar{

    width:8px;

}

.toolbox::-webkit-scrollbar-thumb,
.designer::-webkit-scrollbar-thumb,
.properties::-webkit-scrollbar-thumb{

    background:#cbd5e1;

    border-radius:10px;

}

.toolbox::-webkit-scrollbar-thumb:hover,
.designer::-webkit-scrollbar-thumb:hover,
.properties::-webkit-scrollbar-thumb:hover{

    background:#94a3b8;

}

/* ==========================================================
   EMPTY STATE
========================================================== */

.empty-state{

    padding:40px;

    text-align:center;

    color:var(--text-light);

}

/* ==========================================================
   STYLE PART 2
   TOOLBOX
========================================================== */

/* Toolbox Container */

#toolboxContainer{
    flex:1;
    overflow-y:auto;
    padding:15px;
}

/* Toolbox Groups */

.toolbox-group{
    margin-bottom:24px;
}

.group-title{
    font-size:13px;
    font-weight:700;
    text-transform:uppercase;
    color:#64748b;
    margin-bottom:12px;
    padding-bottom:6px;
    border-bottom:1px solid var(--border);
    letter-spacing:.5px;
}

/* Toolbox Items */

.toolbox-item{

    display:flex;
    align-items:center;
    gap:12px;

    padding:12px 14px;

    margin-bottom:10px;

    background:#fff;

    border:1px solid var(--border);

    border-radius:8px;

    cursor:grab;

    transition:all .2s ease;

    user-select:none;

}

.toolbox-item:hover{

    border-color:var(--primary);

    background:#eff6ff;

    transform:translateY(-2px);

    box-shadow:0 4px 10px rgba(37,99,235,.15);

}

.toolbox-item:active{

    cursor:grabbing;

    transform:scale(.98);

}

/* Icon */

.tool-icon{

    width:38px;
    height:38px;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:8px;

    background:#2563eb;

    color:#fff;

    font-size:18px;

    flex-shrink:0;

}

/* Title */

.tool-title{

    flex:1;

    font-size:14px;

    font-weight:600;

    color:#1f2937;

}

/* Description (optional) */

.tool-description{

    display:block;

    margin-top:2px;

    font-size:12px;

    color:#6b7280;

}

/* Drag States */

.toolbox-item.dragging{

    opacity:.55;

    transform:rotate(2deg);

}

.toolbox-item.drag-over{

    border-color:var(--success);

}

/* Disabled */

.toolbox-item.disabled{

    opacity:.5;

    pointer-events:none;

}

/* Badge */

.toolbox-badge{

    font-size:10px;

    background:#e2e8f0;

    color:#334155;

    border-radius:10px;

    padding:2px 8px;

    font-weight:600;

}

/* Search */

.toolbox-search{

    position:sticky;

    top:0;

    background:#fff;

    z-index:5;

}

.toolbox-search input{

    transition:.2s;

}

.toolbox-search input:focus{

    box-shadow:0 0 0 3px rgba(37,99,235,.15);

}

/* Category Collapse */

.toolbox-group.collapsed .group-body{

    display:none;

}

.group-title{

    cursor:pointer;

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.group-title::after{

    content:"▼";

    font-size:10px;

    color:#94a3b8;

}

.toolbox-group.collapsed .group-title::after{

    content:"►";

}

/* Highlight while dragging */

.toolbox-highlight{

    border:2px dashed var(--primary);

    border-radius:8px;

    background:#eff6ff;

}

/* Smooth animation */

.toolbox-item{

    animation:toolFade .25s ease;

}

@keyframes toolFade{

    from{

        opacity:0;

        transform:translateY(8px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}

/* Small Screens */

@media (max-width:1200px){

    #toolboxContainer{

        padding:10px;

    }

    .toolbox-item{

        padding:10px;

    }

    .tool-icon{

        width:34px;
        height:34px;
        font-size:16px;

    }

    .tool-title{

        font-size:13px;

    }

}

/* ==========================================================
   STYLE PART 3
   DESIGNER CANVAS
========================================================== */

/* Canvas */

#designerCanvas{
    flex:1;
    overflow:auto;
    padding:20px;
    background:#f8fafc;
    min-height:500px;
}

/* Empty State */

.designer-placeholder{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:250px;
    border:2px dashed #cbd5e1;
    border-radius:12px;
    background:#ffffff;
    color:#94a3b8;
    font-size:18px;
    transition:.2s;
}

.designer-placeholder.drag-over{
    border-color:var(--primary);
    background:#eff6ff;
    color:var(--primary);
}

/* Card */

.designer-card{

    display:flex;

    align-items:center;

    gap:15px;

    padding:15px;

    margin-bottom:14px;

    background:#ffffff;

    border:1px solid var(--border);

    border-radius:10px;

    transition:.2s;

    cursor:pointer;

    position:relative;

}

.designer-card:hover{

    border-color:var(--primary);

    box-shadow:0 6px 16px rgba(37,99,235,.12);

}

.designer-card.selected{

    border:2px solid var(--primary);

    background:#eff6ff;

}

/* Drag Handle */

.dragHandle{

    width:36px;

    height:36px;

    border-radius:8px;

    background:#e2e8f0;

    display:flex;

    align-items:center;

    justify-content:center;

    cursor:grab;

    color:#475569;

    flex-shrink:0;

    font-size:18px;

}

.dragHandle:hover{

    background:var(--primary);

    color:#fff;

}

.dragHandle:active{

    cursor:grabbing;

}

/* Info */

.designer-info{

    flex:1;

    min-width:0;

}

.designer-title{

    font-size:15px;

    font-weight:600;

    color:#1f2937;

    white-space:nowrap;

    overflow:hidden;

    text-overflow:ellipsis;

}

.designer-sub{

    margin-top:4px;

    font-size:12px;

    color:#64748b;

}

/* Type Badge */

.designer-type{

    background:var(--primary);

    color:#fff;

    border-radius:20px;

    padding:5px 12px;

    font-size:12px;

    font-weight:600;

    white-space:nowrap;

}

/* Actions */

.designer-actions{

    display:flex;

    gap:8px;

}

.designer-actions button{

    width:34px;

    height:34px;

    border:none;

    border-radius:8px;

    cursor:pointer;

    background:#f1f5f9;

    color:#334155;

    transition:.2s;

    display:flex;

    align-items:center;

    justify-content:center;

}

.designer-actions button:hover{

    background:var(--primary);

    color:#fff;

}

.designer-actions .deleteBtn:hover{

    background:var(--danger);

}

/* Required Badge */

.required-dot{

    width:10px;

    height:10px;

    border-radius:50%;

    background:#16a34a;

}

/* Hidden */

.hidden-badge{

    background:#475569;

    color:#fff;

    font-size:11px;

    padding:3px 8px;

    border-radius:20px;

}

/* Nested Object */

.designer-children{

    margin-left:55px;

    margin-top:12px;

    border-left:3px solid #dbeafe;

    padding-left:18px;

}

/* Drop Indicator */

.drop-indicator{

    height:4px;

    background:var(--primary);

    border-radius:10px;

    margin:8px 0;

}

/* Sortable */

.sortable-ghost{

    opacity:.45;

    background:#dbeafe;

}

.sortable-chosen{

    transform:scale(1.01);

}

.sortable-drag{

    transform:rotate(1deg);

    box-shadow:0 10px 25px rgba(0,0,0,.18);

}

/* Canvas While Dragging */

.canvas-highlight{

    border:2px dashed var(--primary);

    background:#eff6ff;

}

/* Card Animation */

.designer-card{

    animation:designerFade .18s ease;

}

@keyframes designerFade{

    from{

        opacity:0;

        transform:translateY(10px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}

/* Context Menu Placeholder */

.designer-context{

    position:absolute;

    top:10px;

    right:10px;

}

/* Footer */

.card-footer{

    margin-top:10px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    font-size:12px;

    color:#64748b;

}

/* Responsive */

@media (max-width:1200px){

    #designerCanvas{

        padding:15px;

    }

    .designer-card{

        padding:12px;

    }

}

@media (max-width:768px){

    .designer-card{

        flex-wrap:wrap;

        align-items:flex-start;

    }

    .designer-actions{

        width:100%;

        justify-content:flex-end;

        margin-top:10px;

    }

    .designer-type{

        margin-left:50px;

    }

}


/* ==========================================================
   STYLE PART 4
   PROPERTY PANEL
========================================================== */

#propertyPanel{
    flex:1;
    overflow-y:auto;
    padding:18px;
    background:#ffffff;
}

/* Form */

.property-form{
    display:flex;
    flex-direction:column;
    gap:18px;
}

/* Sections */

.property-section{
    border:1px solid #e5e7eb;
    border-radius:10px;
    overflow:hidden;
    background:#fff;
}

.property-section-title{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 16px;
    font-size:14px;
    font-weight:700;
    background:#f8fafc;
    border-bottom:1px solid #e5e7eb;
    cursor:pointer;
    user-select:none;
}

.property-section-body{
    padding:16px;
}

/* Labels */

.form-group{
    display:flex;
    flex-direction:column;
    margin-bottom:16px;
}

.form-group:last-child{
    margin-bottom:0;
}

.form-group label{
    font-size:13px;
    font-weight:600;
    color:#374151;
    margin-bottom:6px;
}

/* Inputs */

.form-group input,
.form-group textarea,
.form-group select{

    width:100%;

    padding:10px 12px;

    border:1px solid #d1d5db;

    border-radius:8px;

    background:#fff;

    color:#111827;

    font-size:14px;

    transition:.2s;

}

.form-group textarea{
    resize:vertical;
    min-height:90px;
    font-family:inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus{

    outline:none;

    border-color:var(--primary);

    box-shadow:0 0 0 3px rgba(37,99,235,.12);

}

/* Placeholder */

.form-group input::placeholder,
.form-group textarea::placeholder{
    color:#9ca3af;
}

/* Two Column */

.grid2{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

/* Three Column */

.grid3{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
}

/* Checkbox */

.check{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:14px;
    margin-bottom:10px;
    cursor:pointer;
}

.check input[type="checkbox"]{
    width:18px;
    height:18px;
    accent-color:var(--primary);
}

/* Switch */

.switch{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:8px 0;
}

/* Enum */

.enum-editor{
    min-height:120px;
    font-family:Consolas, monospace;
}

/* Property Hint */

.property-help{
    margin-top:5px;
    font-size:12px;
    color:#6b7280;
}

/* Validation */

.input-error{
    border-color:#dc2626 !important;
    background:#fef2f2;
}

.validation-message{
    margin-top:5px;
    font-size:12px;
    color:#dc2626;
}

/* Readonly */

.readonly{
    background:#f3f4f6 !important;
    cursor:not-allowed;
}

/* Buttons */

.property-buttons{
    display:flex;
    gap:10px;
    margin-top:10px;
}

.property-buttons button{

    flex:1;

    padding:10px;

    border:none;

    border-radius:8px;

    cursor:pointer;

    background:var(--primary);

    color:#fff;

    font-weight:600;

    transition:.2s;

}

.property-buttons button:hover{
    background:var(--primary-dark);
}

.property-buttons .danger{
    background:#dc2626;
}

.property-buttons .danger:hover{
    background:#b91c1c;
}

/* Sticky Footer */

.property-footer{
    position:sticky;
    bottom:0;
    background:#fff;
    padding-top:12px;
    border-top:1px solid #e5e7eb;
}

/* Scrollbar */

#propertyPanel::-webkit-scrollbar{
    width:8px;
}

#propertyPanel::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:8px;
}

#propertyPanel::-webkit-scrollbar-thumb:hover{
    background:#94a3b8;
}

/* Responsive */

@media (max-width:900px){

    .grid2,
    .grid3{
        grid-template-columns:1fr;
    }

}

/* ==========================================================
   STYLE PART 5
   JSON PREVIEW + UTILITIES
========================================================== */

/* ==========================================================
   JSON PANEL
========================================================== */

.json-panel{
    height:200px;
    display:flex;
    flex-direction:column;
    background:#ffffff;
    border-top:1px solid var(--border);
    box-shadow:0 -2px 10px rgba(0,0,0,.05);
}

.json-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px 18px;
    background:#f8fafc;
    border-bottom:1px solid var(--border);
}

.json-header h3{
    font-size:15px;
    font-weight:600;
    color:#334155;
}

.json-toolbar{
    display:flex;
    gap:10px;
}

.json-toolbar button,
#btnFormat{
    border:none;
    cursor:pointer;
    padding:8px 14px;
    border-radius:8px;
    background:var(--primary);
    color:#fff;
    font-size:13px;
    transition:.2s;
}

.json-toolbar button:hover,
#btnFormat:hover{
    background:var(--primary-dark);
}

/* ==========================================================
   JSON VIEWER
========================================================== */

#jsonPreview{

    flex:1;

    overflow:auto;

    margin:0;

    padding:18px;

    background:#0f172a;

    color:#e2e8f0;

    font-size:13px;

    line-height:1.6;

    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;

    white-space:pre;

}

/* Optional syntax colors */

.json-key{
    color:#7dd3fc;
}

.json-string{
    color:#86efac;
}

.json-number{
    color:#fbbf24;
}

.json-boolean{
    color:#f472b6;
}

.json-null{
    color:#94a3b8;
}

/* Scrollbars */

#jsonPreview::-webkit-scrollbar{
    width:10px;
    height:10px;
}

#jsonPreview::-webkit-scrollbar-thumb{
    background:#475569;
    border-radius:10px;
}

#jsonPreview::-webkit-scrollbar-track{
    background:#1e293b;
}

/* ==========================================================
   STATUS BAR
========================================================== */

.status-bar{

    height:34px;

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:0 16px;

    background:#f8fafc;

    border-top:1px solid var(--border);

    font-size:12px;

    color:#64748b;

}

.status-left,
.status-right{

    display:flex;

    gap:16px;

    align-items:center;

}

/* ==========================================================
   TOAST
========================================================== */

.toast-container{

    position:fixed;

    top:20px;

    right:20px;

    z-index:5000;

    display:flex;

    flex-direction:column;

    gap:12px;

}

.toast{

    min-width:260px;

    padding:14px 18px;

    border-radius:10px;

    color:#fff;

    font-size:14px;

    box-shadow:0 10px 25px rgba(0,0,0,.18);

    animation:toastIn .25s ease;

}

.toast.success{
    background:#16a34a;
}

.toast.error{
    background:#dc2626;
}

.toast.warning{
    background:#f59e0b;
}

.toast.info{
    background:#2563eb;
}

@keyframes toastIn{

    from{

        opacity:0;

        transform:translateX(40px);

    }

    to{

        opacity:1;

        transform:translateX(0);

    }

}

/* ==========================================================
   LOADER
========================================================== */

.loader{

    width:34px;

    height:34px;

    border:4px solid #e5e7eb;

    border-top:4px solid var(--primary);

    border-radius:50%;

    animation:spin .9s linear infinite;

}

@keyframes spin{

    from{

        transform:rotate(0deg);

    }

    to{

        transform:rotate(360deg);

    }

}

/* ==========================================================
   MODAL
========================================================== */

.modal{

    position:fixed;

    inset:0;

    display:none;

    align-items:center;

    justify-content:center;

    background:rgba(15,23,42,.45);

    z-index:9999;

}

.modal.show{

    display:flex;

}

.modal-dialog{

    width:650px;

    max-width:92%;

    background:#fff;

    border-radius:12px;

    overflow:hidden;

    box-shadow:0 20px 40px rgba(0,0,0,.22);

}

.modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:16px 20px;

    border-bottom:1px solid var(--border);

}

.modal-header h2{

    font-size:18px;

}

.modal-close{

    cursor:pointer;

    border:none;

    background:none;

    font-size:22px;

}

.modal-body{

    padding:20px;

    max-height:70vh;

    overflow:auto;

}

.modal-footer{

    display:flex;

    justify-content:flex-end;

    gap:10px;

    padding:16px 20px;

    border-top:1px solid var(--border);

}

/* ==========================================================
   BADGES
========================================================== */

.badge{

    display:inline-flex;

    align-items:center;

    padding:4px 10px;

    border-radius:20px;

    font-size:11px;

    font-weight:600;

}

.badge.primary{
    background:#dbeafe;
    color:#1d4ed8;
}

.badge.success{
    background:#dcfce7;
    color:#15803d;
}

.badge.warning{
    background:#fef3c7;
    color:#b45309;
}

.badge.danger{
    background:#fee2e2;
    color:#b91c1c;
}

/* ==========================================================
   HELPERS
========================================================== */

.hidden{
    display:none !important;
}

.text-center{
    text-align:center;
}

.text-right{
    text-align:right;
}

.mt-10{margin-top:10px;}
.mt-20{margin-top:20px;}
.mb-10{margin-bottom:10px;}
.mb-20{margin-bottom:20px;}

.flex{
    display:flex;
}

.flex-between{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.gap-10{
    gap:10px;
}

.gap-20{
    gap:20px;
}

.w-100{
    width:100%;
}

.round{
    border-radius:50%;
}

.shadow{
    box-shadow:var(--shadow);
}

.border{
    border:1px solid var(--border);
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width:768px){

    .json-panel{
        height:260px;
    }

    .json-header{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .json-toolbar{
        width:100%;
        flex-wrap:wrap;
    }

    .status-bar{
        flex-direction:column;
        height:auto;
        padding:10px;
        gap:8px;
    }

    .toast{
        min-width:220px;
    }

}

/* ==========================================================
   STYLE PART 6
   DARK THEME + TREE VIEW + FINAL POLISH
========================================================== */

/* ==========================================================
   DARK THEME
========================================================== */

body.dark{

    --background:#0f172a;
    --panel:#1e293b;

    --border:#334155;

    --text:#f1f5f9;
    --text-light:#94a3b8;

    background:var(--background);
    color:var(--text);

}

body.dark .topbar,
body.dark .toolbox,
body.dark .designer,
body.dark .properties,
body.dark .json-panel{

    background:var(--panel);
    color:var(--text);

}

body.dark .panel-title,
body.dark .json-header{

    background:#172554;
    border-color:#334155;

}

body.dark input,
body.dark textarea,
body.dark select{

    background:#0f172a;
    color:#f8fafc;
    border-color:#475569;

}

body.dark .designer-card{

    background:#1e293b;
    border-color:#475569;

}

body.dark .designer-card.selected{

    background:#1e40af33;
    border-color:#3b82f6;

}

body.dark .toolbox-item{

    background:#1e293b;
    border-color:#475569;

}

body.dark .toolbox-item:hover{

    background:#1d4ed822;

}

body.dark #jsonPreview{

    background:#020617;

}

/* ==========================================================
   TREE VIEW
========================================================== */

.tree-container{

    padding-left:20px;

}

.tree-node{

    position:relative;

    margin:8px 0;

}

.tree-node::before{

    content:"";

    position:absolute;

    left:-12px;
    top:0;

    width:2px;
    height:100%;

    background:#cbd5e1;

}

.tree-node:last-child::before{

    height:18px;

}

.tree-title{

    display:flex;

    align-items:center;

    gap:8px;

    cursor:pointer;

    padding:6px 10px;

    border-radius:6px;

    transition:.2s;

}

.tree-title:hover{

    background:#eff6ff;

}

body.dark .tree-title:hover{

    background:#1d4ed822;

}

.tree-toggle{

    width:18px;

    text-align:center;

    color:#64748b;

    cursor:pointer;

}

.tree-children{

    margin-left:20px;

}

/* ==========================================================
   OBJECT CONTAINER
========================================================== */

.object-container{

    border-left:3px solid #3b82f6;

    margin-left:18px;

    padding-left:16px;

    margin-top:10px;

}

/* ==========================================================
   DROP ZONES
========================================================== */

.drop-zone{

    border:2px dashed transparent;

    min-height:12px;

    transition:.15s;

}

.drop-zone.active{

    border-color:#3b82f6;

    background:#dbeafe;

}

body.dark .drop-zone.active{

    background:#1d4ed822;

}

/* ==========================================================
   SORTABLE
========================================================== */

.sortable-ghost{

    opacity:.45;

    border:2px dashed #2563eb;

    background:#dbeafe;

}

body.dark .sortable-ghost{

    background:#1d4ed822;

}

.sortable-chosen{

    transform:scale(1.02);

}

.sortable-drag{

    transform:rotate(1deg);

    box-shadow:0 15px 30px rgba(0,0,0,.30);

}

/* ==========================================================
   BUTTON EFFECTS
========================================================== */

button{

    transition:
        background .18s,
        transform .15s,
        box-shadow .18s;

}

button:hover{

    box-shadow:0 6px 18px rgba(37,99,235,.18);

}

button:active{

    transform:scale(.97);

}

/* ==========================================================
   CARD HOVER
========================================================== */

.designer-card,
.toolbox-item{

    transition:
        transform .18s,
        box-shadow .18s,
        border-color .18s;

}

.designer-card:hover{

    transform:translateY(-2px);

}

.toolbox-item:hover{

    transform:translateY(-2px);

}

/* ==========================================================
   PROPERTY GROUPS
========================================================== */

.property-section{

    transition:.2s;

}

.property-section.collapsed
.property-section-body{

    display:none;

}

.property-section-title{

    user-select:none;

}

.property-section-title::after{

    content:"▼";

    color:#94a3b8;

}

.property-section.collapsed
.property-section-title::after{

    content:"►";

}

/* ==========================================================
   LOADING OVERLAY
========================================================== */

.loading-overlay{

    position:absolute;

    inset:0;

    background:rgba(255,255,255,.75);

    display:flex;

    align-items:center;

    justify-content:center;

    z-index:500;

}

body.dark .loading-overlay{

    background:rgba(15,23,42,.80);

}

/* ==========================================================
   PULSE
========================================================== */

.pulse{

    animation:pulse 1s infinite;

}

@keyframes pulse{

    0%{

        transform:scale(1);

    }

    50%{

        transform:scale(1.05);

    }

    100%{

        transform:scale(1);

    }

}

/* ==========================================================
   FADE
========================================================== */

.fade-in{

    animation:fadeIn .25s ease;

}

@keyframes fadeIn{

    from{

        opacity:0;

        transform:translateY(10px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}

/* ==========================================================
   SLIDE
========================================================== */

.slide-right{

    animation:slideRight .20s ease;

}

@keyframes slideRight{

    from{

        opacity:0;

        transform:translateX(-15px);

    }

    to{

        opacity:1;

        transform:translateX(0);

    }

}

/* ==========================================================
   FOCUS
========================================================== */

:focus-visible{

    outline:3px solid rgba(37,99,235,.25);
    outline-offset:2px;

}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width:1200px){

    .workspace{

        grid-template-columns:
            240px
            1fr
            300px;

    }

}

@media (max-width:992px){

    .workspace{

        grid-template-columns:1fr;

        grid-template-rows:auto auto auto;

    }

    .toolbox{

        max-height:300px;

    }

    .properties{

        max-height:500px;

    }

}

@media (max-width:768px){

    .topbar{

        flex-direction:column;

        align-items:flex-start;

        gap:12px;

        height:auto;

        padding:15px;

    }

    .toolbar{

        flex-wrap:wrap;

        width:100%;

    }

    .toolbar button{

        flex:1;

        min-width:120px;

    }

}

@media (max-width:480px){

    .toolbar{

        display:grid;

        grid-template-columns:1fr 1fr;

        gap:8px;

    }

    .designer-card{

        flex-direction:column;

        align-items:flex-start;

    }

    .designer-actions{

        width:100%;
        justify-content:flex-end;

    }

}

/* ==========================================================
   PRINT
========================================================== */

@media print{

    .toolbar,
    .toolbox,
    .properties{

        display:none;

    }

    .designer{

        width:100%;

        border:none;

    }

    .json-panel{

        height:auto;

    }

}

.property-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

}

.property-tabs{

    display:flex;

    gap:8px;

}

.property-tab{

    border:none;

    background:#f1f5f9;

    padding:6px 12px;

    border-radius:6px;

    cursor:pointer;

}

.property-tab.active{

    background:#2563eb;

    color:white;

}

