/* 3D Computer Lab - Bagel Byte Academy */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: #16161f;
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #00ff88;
    --accent-warning: #ffaa00;
    --accent-danger: #ff4757;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --border-color: #2a2a3a;
    --glow-primary: rgba(0, 212, 255, 0.3);
    --glow-secondary: rgba(124, 58, 237, 0.3);
    --gradient-1: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    --gradient-2: linear-gradient(135deg, #7c3aed 0%, #ff4757 100%);
    --gradient-3: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: var(--gradient-1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 0 30px var(--glow-primary);
}


.loader-content h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-bar {
    width: 300px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 15px;
}

.loader-progress {
    height: 100%;
    width: 0%;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

.loader-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateX(-3px);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-logo i {
    color: var(--accent-primary);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 10px;
}

.view-btn, .mode-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.view-btn:hover, .mode-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.mode-btn.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: white;
}

/* Canvas Container */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#computerCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Instructions Overlay */
.instructions {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 22, 31, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px 35px;
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 50;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.instructions.hidden {
    display: none;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.instruction-item i {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.dismiss-btn {
    padding: 10px 20px;
    background: var(--gradient-1);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dismiss-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--glow-primary);
}

/* Quick Select Panel */
.quick-select {
    position: fixed;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

.quick-btn {
    width: 50px;
    height: 50px;
    background: rgba(22, 22, 31, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.quick-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateX(5px);
    box-shadow: 0 0 20px var(--glow-primary);
}

.quick-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Info Panel */
.info-panel {
    position: fixed;
    right: 0;
    top: 74px;
    bottom: 0;
    width: 400px;
    background: rgba(16, 16, 22, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 50;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s ease;
}

.info-panel.open {
    transform: translateX(0);
}

.panel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
}

.panel-header {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.panel-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px var(--glow-primary);
}

.panel-header h2 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.panel-content {
    padding: 25px 30px;
}

.panel-hint {
    color: var(--text-muted);
    font-style: italic;
}

.panel-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.spec-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 15px;
}

.spec-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.spec-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Timeline Section */
.timeline-section, .facts-section, .usage-section {
    padding: 25px 30px;
    border-top: 1px solid var(--border-color);
}

.timeline-section h3, .facts-section h3, .usage-section h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-section h3 i {
    color: var(--accent-secondary);
}

.facts-section h3 i {
    color: var(--accent-warning);
}

.usage-section h3 i {
    color: var(--accent-tertiary);
}

.timeline {
    position: relative;
    padding-left: 25px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--accent-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow-secondary);
}

.timeline-year {
    font-size: 0.8rem;
    color: var(--accent-secondary);
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Facts List */
.facts-list {
    list-style: none;
}

.facts-list li {
    padding: 12px 0;
    padding-left: 25px;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.facts-list li:last-child {
    border-bottom: none;
}

.facts-list li::before {
    content: '\f0eb';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    position: absolute;
    left: 0;
    color: var(--accent-warning);
}

/* Usage Grid */
.usage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.usage-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.usage-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.2);
}

.usage-item i {
    font-size: 1.5rem;
    color: var(--accent-tertiary);
    margin-bottom: 8px;
}

.usage-item span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Data Flow Legend */
.data-flow-legend {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(22, 22, 31, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    z-index: 50;
}

.data-flow-legend h4 {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

/* Easter Egg Popup */
.easter-egg-popup {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--gradient-2);
    padding: 15px 30px;
    border-radius: 50px;
    z-index: 200;
    opacity: 0;
    transition: all 0.4s ease;
}

.easter-egg-popup.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.egg-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
}

.egg-content i {
    color: var(--accent-warning);
}

/* Component Labels */
.component-labels {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.component-label {
    position: absolute;
    background: rgba(0, 212, 255, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--glow-primary);
}

.component-label:hover {
    transform: scale(1.1);
    background: var(--accent-primary);
}

.component-label::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid rgba(0, 212, 255, 0.9);
}

/* Scrollbar Styling */
.info-panel::-webkit-scrollbar {
    width: 6px;
}

.info-panel::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.info-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Responsive */
@media (max-width: 900px) {
    .info-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 50%;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid var(--border-color);
        border-radius: 20px 20px 0 0;
    }

    .info-panel.open {
        transform: translateY(0);
    }

    .quick-select {
        left: 10px;
        gap: 8px;
    }

    .quick-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .instructions {
        flex-wrap: wrap;
        justify-content: center;
        padding: 20px;
        gap: 15px;
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: none;
    }

    .main-nav {
        padding: 10px 15px;
    }

    .back-btn span {
        display: none;
    }

    .nav-logo {
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    .view-btn, .mode-btn {
        width: 38px;
        height: 38px;
    }

    .nav-divider {
        display: none;
    }

    .instructions {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-flow-legend {
        display: none;
    }
}

/* X-Ray Mode Styles */
body.xray-mode .component-label {
    background: var(--accent-secondary);
}

body.xray-mode .component-label::after {
    border-top-color: var(--accent-secondary);
}

/* 3D Floating Labels */
.label-3d {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.label-3d:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.6);
    background: linear-gradient(135deg, rgba(0, 212, 255, 1) 0%, rgba(124, 58, 237, 1) 100%);
}

.label-3d::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(124, 58, 237, 0.9);
}

/* X-ray mode label styling */
body.xray-mode .label-3d {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.9) 0%, rgba(255, 71, 87, 0.9) 100%);
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4);
}

body.xray-mode .label-3d::before {
    border-top-color: rgba(255, 71, 87, 0.9);
}

