/**
 * QUANTUM CONSTELLATION - Visual Agent Builder Component Library
 * Revolutionary orbital design with all components visible
 * No scrolling, quantum-level innovation
 */

/* ============================================================================ */
/* QUANTUM COMPONENT PANEL - Expanded & Visible */
/* ============================================================================ */

.component-panel {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    background: linear-gradient(135deg, 
        rgba(5, 5, 15, 0.98) 0%, 
        rgba(15, 10, 25, 0.96) 30%,
        rgba(25, 15, 35, 0.98) 70%,
        rgba(10, 5, 20, 0.99) 100%) !important;
    border-right: 3px solid rgba(0, 255, 255, 0.5) !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-shrink: 0;
    box-shadow: 
        inset -10px 0 30px rgba(0, 255, 255, 0.2),
        0 0 40px rgba(0, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) saturate(180%);
    display: flex !important;
    flex-direction: column !important;
}

/* ============================================================================ */
/* QUANTUM CONTROL STRIP */
/* ============================================================================ */

.quantum-control-strip {
    padding: 1rem;
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.15), 
        rgba(102, 126, 234, 0.1));
    border-bottom: 2px solid rgba(0, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.quantum-search {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.quantum-search:focus {
    outline: none;
    border-color: rgba(0, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

.quantum-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.quantum-filters {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.4rem 0.75rem;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #00ffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background: rgba(0, 255, 255, 0.25);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

/* ============================================================================ */
/* QUANTUM CONSTELLATION CANVAS */
/* ============================================================================ */

.quantum-constellation-canvas {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.5rem;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.3) transparent;
}

.quantum-constellation-canvas::-webkit-scrollbar {
    width: 6px;
}

.quantum-constellation-canvas::-webkit-scrollbar-track {
    background: transparent;
}

.quantum-constellation-canvas::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.quantum-constellation-canvas::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

/* ============================================================================ */
/* CATEGORY NUCLEUS - Orbital Centers */
/* ============================================================================ */

.category-nucleus {
    position: relative;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.08), 
        rgba(102, 126, 234, 0.06));
    border: 1px solid rgba(0, 255, 255, 0.3);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-nucleus:hover {
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.nucleus-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: linear-gradient(90deg, 
        rgba(0, 255, 255, 0.15), 
        rgba(102, 126, 234, 0.1));
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nucleus-header:hover {
    background: linear-gradient(90deg, 
        rgba(0, 255, 255, 0.25), 
        rgba(102, 126, 234, 0.15));
}

.nucleus-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    font-size: 0.875rem;
}

.nucleus-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: #00ffff;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

.nucleus-count {
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.nucleus-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s ease;
}

.category-nucleus.expanded .nucleus-toggle {
    transform: rotate(180deg);
}

/* ============================================================================ */
/* ORBITAL GRID - Component Chips */
/* ============================================================================ */

.orbital-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.75rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-nucleus.expanded .orbital-grid {
    max-height: 2000px;
}

.component-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.1), 
        rgba(102, 126, 234, 0.08));
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 10px;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.component-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
}

.component-chip:hover::before {
    left: 100%;
}

.component-chip:hover {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.2), 
        rgba(102, 126, 234, 0.15));
    border-color: rgba(0, 255, 255, 0.5);
    transform: translateX(5px) scale(1.02);
    box-shadow: 
        0 4px 20px rgba(0, 255, 255, 0.3),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.component-chip:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.chip-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chip-content {
    flex: 1;
    min-width: 0;
}

.chip-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.chip-description {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.chip-badge {
    padding: 0.2rem 0.4rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.chip-badge.popular {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffc107;
}

.chip-badge.essential {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.4);
    color: #28a745;
}

.chip-credits {
    font-size: 0.65rem;
    color: rgba(0, 255, 255, 0.7);
}

/* ============================================================================ */
/* QUANTUM ANIMATIONS */
/* ============================================================================ */

@keyframes quantumPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes quantumGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
    }
}

.component-chip.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* ============================================================================ */
/* RESPONSIVE QUANTUM DESIGN */
/* ============================================================================ */

@media (max-width: 1440px) {
    .component-panel {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
    }
    
    .chip-description {
        display: none;
    }
}

@media (max-width: 1280px) {
    .component-panel {
        width: 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
    }
    
    .chip-title {
        font-size: 0.75rem;
    }
}

/* ============================================================================ */
/* EXPAND ALL MODE - Show Everything */
/* ============================================================================ */

.component-panel.expand-all .category-nucleus {
    margin-bottom: 0.5rem;
}

.component-panel.expand-all .orbital-grid {
    max-height: none !important;
}

.expand-all-toggle {
    padding: 0.5rem 1rem;
    margin: 0.5rem;
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.15), 
        rgba(102, 126, 234, 0.1));
    border: 1px solid rgba(0, 255, 255, 0.4);
    border-radius: 10px;
    color: #00ffff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.expand-all-toggle:hover {
    background: linear-gradient(135deg, 
        rgba(0, 255, 255, 0.25), 
        rgba(102, 126, 234, 0.15));
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

/* ============================================================================ */
/* PERFORMANCE OPTIMIZATIONS */
/* ============================================================================ */

.component-chip,
.category-nucleus {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .component-chip,
    .category-nucleus,
    .nucleus-toggle {
        transition: none;
        animation: none;
    }
    
    .component-chip::before {
        display: none;
    }
}
