/* ==========================================================================
   Schematic Editor Toolbar & Canvas Styles
   ========================================================================== */

.schematic-toolbar {
    min-height: 40px;
    height: auto;
    background: rgba(8, 14, 28, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    padding: 4px 10px;
    gap: 8px;
    flex-shrink: 0;
    overflow: visible !important;
    position: relative;
    z-index: 500;
}

.toolbar-cluster {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cluster-label {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-right: 5px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-group {
    display: flex;
    gap: 4px;
}

.tool-btn {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-0.5px);
}

.tool-btn.active {
    background-color: rgba(14, 165, 233, 0.28);
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 12px rgba(56, 189, 248, 0.25);
}

.tool-divider {
    width: 1px;
    height: 18px;
    background-color: rgba(255, 255, 255, 0.08);
    margin: 0 2px;
}

.palette-items {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-palette-items {
    margin-left: auto;
}

.palette-btn {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.palette-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.09);
    transform: translateY(-0.5px);
}

/* ==========================================================================
   Component Dropdown Palettes
   ========================================================================== */

.palette-dropdowns-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.active-category-shelf {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.active-category-shelf::-webkit-scrollbar {
    display: none;
}

.category-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.palette-dropdown {
    position: relative;
}

.palette-dropdown-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.palette-dropdown-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.22);
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-0.5px);
}

.palette-dropdown-btn.active,
.palette-dropdown.open .palette-dropdown-btn {
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.55);
    background-color: rgba(14, 165, 233, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 12px rgba(56, 189, 248, 0.25);
}

.palette-dropdown-btn .chevron {
    font-size: 9px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.palette-dropdown.open .palette-dropdown-btn .chevron {
    transform: rotate(180deg);
}

.palette-btn-highlight {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
    border-color: rgba(56, 189, 248, 0.45);
    color: #38bdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.palette-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1200;
    min-width: 280px;
    min-height: 180px;
    max-width: min(90vw, 1200px);
    max-height: min(85vh, 850px);
    width: 380px;
    height: 420px;
    box-sizing: border-box;
    resize: both;
    overflow: auto;
    background: rgba(10, 16, 32, 0.92);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 24px rgba(56, 189, 248, 0.15);
    padding: 10px 10px 18px 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
    animation: dropdownFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.palette-dropdown-menu::-webkit-resizer {
    background-color: transparent;
    background-image: radial-gradient(circle, rgba(56, 189, 248, 0.6) 1.5px, transparent 1.5px);
    background-size: 4px 4px;
    background-repeat: repeat;
}

.palette-resize-grip {
    position: sticky;
    bottom: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    margin-top: auto;
    margin-left: auto;
    margin-bottom: -12px;
    margin-right: -4px;
    cursor: nwse-resize;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    z-index: 10;
}

.palette-resize-grip:hover,
.palette-dropdown-menu:hover .palette-resize-grip {
    opacity: 1;
}

.palette-resize-grip svg {
    width: 12px;
    height: 12px;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.palette-dropdown.open .palette-dropdown-menu {
    display: flex;
}

.dropdown-section-header {
    display: flex;
    align-items: center;
    padding: 4px 6px 2px 6px;
    margin-top: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dropdown-section-header:first-child {
    margin-top: 0;
}

.dropdown-section-header .section-title {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 4px;
    padding: 2px 0;
}

.palette-menu-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
    color: #cbd5e1;
}

.palette-menu-item:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.item-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 24px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0 4px;
    flex-shrink: 0;
}

.item-badge.color-cyan {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.item-badge.color-amber {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.item-badge.color-green {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.item-badge.color-purple {
    background: rgba(168, 85, 247, 0.18);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.item-badge.color-red {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.item-badge.color-slate {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.item-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.item-name {
    font-size: 11px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-desc {
    font-size: 9px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette-mega-menu {
    width: 520px;
    height: 520px;
    min-width: 360px;
    min-height: 280px;
    max-width: min(92vw, 1300px);
    max-height: min(88vh, 900px);
    resize: both;
    overflow: auto;
}

.palette-search-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    padding: 5px 8px;
    margin-bottom: 4px;
}

.palette-search-container .search-icon {
    font-size: 11px;
    color: #94a3b8;
}

.palette-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-size: 11px;
    font-family: inherit;
}

.palette-search-input::placeholder {
    color: #64748b;
}

.palette-mega-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.canvas-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-stage);
}

.canvas-viewport canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Inspector in Sidebar */
#propertyInspector {
    font-size: 11px;
}

.inspector-header {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--accent-blue);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.inspector-fields {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 10.5px;
    text-align: center;
    padding: 10px 4px;
    line-height: 1.5;
}
