:root {
    --bg-dark: #07090e;
    --panel-bg: rgba(14, 20, 32, 0.85);
    --panel-border: rgba(0, 243, 255, 0.18);
    --panel-border-glow: rgba(0, 243, 255, 0.4);
    
    --text-primary: #f0f4fc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #00f3ff;
    --accent-purple: #a855f7;
    --accent-emerald: #10b981;
    --accent-magenta: #ec4899;
    --accent-amber: #f59e0b;
    --accent-coral: #ff6b6b;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 9, 14, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 243, 255, 0.1);
    border-top: 3px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--accent-cyan);
}

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

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header */
.cyber-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 60px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(10, 15, 26, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.yzo-mark {
    height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.35));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.wordmark {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #f2903c, #b0479f, #6d5bd0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.brand-text h1 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ffffff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Nav Tabs */
.mode-tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--bg-dark);
    background: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(0, 243, 255, 0.4);
}

/* Sol Panel */
.left-panel {
    position: absolute;
    top: 96px;
    left: 20px;
    width: 300px;
    max-height: calc(100vh - 160px);
    z-index: 10;
    padding: 20px;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.panel-header h3 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.margin-top {
    margin-top: 20px;
}

/* Region Selector Grid */
.region-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.region-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.region-btn .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--region-color);
    box-shadow: 0 0 8px var(--region-color);
}

.region-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.region-btn.active {
    background: rgba(0, 243, 255, 0.12);
    border-color: var(--region-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.25);
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-group label {
    margin-bottom: 0;
}

.cyber-switch {
    width: 36px;
    height: 20px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;
}

.cyber-switch:checked {
    background: var(--accent-cyan);
}

.cyber-switch::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    background: #fff;
    transition: transform 0.3s ease;
}

.cyber-switch:checked::before {
    transform: translateX(16px);
    background: var(--bg-dark);
}

/* Palet Seçici */
.palette-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    margin-bottom: 14px;
}

.pal-btn {
    padding: 7px 4px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pal-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }

.pal-btn.active {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.18), rgba(168, 85, 247, 0.18));
    color: var(--accent-cyan);
    box-shadow: inset 0 0 0 1px rgba(0, 243, 255, 0.35);
}

.toggle-group label em {
    font-style: normal;
    opacity: 0.55;
    font-size: 10px;
}

.slider-group input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.6);
}

.camera-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cam-btn {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cam-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Sağ Panel */
.right-panel {
    position: absolute;
    top: 96px;
    right: 20px;
    width: 360px;
    max-height: calc(100vh - 160px);
    z-index: 10;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.region-badge {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 12px var(--accent-cyan);
}

.latin-name {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    font-style: italic;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-scroll-content {
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-scroll-content::-webkit-scrollbar {
    width: 4px;
}
.panel-scroll-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.info-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-section p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
    font-weight: 500;
}

.spec-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-list li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 2px solid var(--accent-cyan);
}

.spec-list li strong {
    color: var(--text-primary);
}

/* Simulation Bottom Panel */
.bottom-panel {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 650px;
    padding: 20px;
    z-index: 10;
}

.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.sim-header h3 {
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--accent-cyan);
}

.hint-text {
    font-size: 11px;
    color: var(--text-muted);
}

.sim-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.sim-slider-box {
    flex: 1;
}

.sim-slider-box label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cyber-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cyber-btn.primary {
    background: linear-gradient(135deg, var(--accent-cyan), #00a8ff);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

.cyber-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.6);
}

/* Quiz Card */
.quiz-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    padding: 28px;
    z-index: 20;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 16px;
}

.quiz-card h3 {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-opt-btn {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 10px;
    font-family: var(--font-main);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-opt-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--accent-cyan);
}

.quiz-opt-btn.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
}

.quiz-opt-btn.wrong {
    background: rgba(255, 107, 107, 0.2);
    border-color: var(--accent-coral);
    color: var(--accent-coral);
}

.quiz-feedback {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.quiz-feedback.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.quiz-feedback.error {
    background: rgba(255, 107, 107, 0.15);
    color: var(--accent-coral);
}

/* Floating Tooltip */
.floating-tooltip {
    position: absolute;
    z-index: 100;
    pointer-events: none;
    padding: 6px 12px;
    background: rgba(10, 15, 26, 0.9);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 243, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.1s ease;
    transform: translate(-50%, -120%);
}

/* Footer */
.cyber-footer {
    position: absolute;
    bottom: 16px;
    left: 20px;
    right: 20px;
    z-index: 10;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.footer-info {
    display: flex;
    gap: 20px;
    padding: 8px 20px;
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
}

.hidden {
    display: none !important;
}

/* Seçili yapı bloğu + zenginleştirilmiş tooltip (Z-Anatomy geçişi) */
.structure-name {
    font-size: 15px !important;
    font-weight: 600;
    color: #ffd766 !important;
}

.structure-side {
    font-size: 11.5px !important;
    color: var(--text-secondary) !important;
    margin-top: 3px;
}

.floating-tooltip strong { display: block; }

.floating-tooltip .tip-region {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.65;
}

/* Lisans atfı — CC BY-SA gereği ekranda görünür olmalı */
.cyber-footer .attrib {
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.55;
    font-size: 9.5px;
}

/* ============================================================
   MOBİL DÜZEN (<= 860px)
   Masaüstünde paneller sabit yan sütunlar; telefonda ekranın
   tamamını kaplıyorlardı. Mobilde alttan açılan çekmeceye
   dönüşüyorlar, 3B sahne tam ekran kalıyor.
   ============================================================ */
.mobile-bar { display: none; }

@media (max-width: 860px) {
    /* Başlık: tek satır, kompakt */
    .cyber-header {
        top: 10px; left: 10px; right: 10px;
        height: 52px;
        padding: 0 12px;
        gap: 8px;
    }
    .yzo-mark { height: 30px; }
    .wordmark { font-size: 8px; letter-spacing: 0.12em; }
    .brand-text h1 { font-size: 12px; letter-spacing: 0.5px; white-space: nowrap; }
    .badge { display: none; }

    .mode-tabs { padding: 3px; gap: 2px; flex-shrink: 0; }
    .tab-btn { padding: 7px 9px; font-size: 0; gap: 0; }
    .tab-btn svg { width: 17px; height: 17px; }

    /* Paneller -> alt çekmece */
    .left-panel, .right-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-height: 62vh;
        padding: 16px 16px 76px;
        border-radius: 18px 18px 0 0;
        border-bottom: none;
        transform: translateY(101%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 30;
    }

    .left-panel.open, .right-panel.open { transform: translateY(0); }

    /* Çekmece tutamağı */
    .left-panel::before, .right-panel::before {
        content: '';
        position: sticky;
        top: 0;
        display: block;
        width: 38px;
        height: 4px;
        margin: -6px auto 12px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.22);
    }

    .region-selector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .region-btn { font-size: 11px; padding: 10px 8px; }
    .camera-grid { grid-template-columns: 1fr 1fr 1fr; }
    .cam-btn { font-size: 10px; padding: 9px 4px; }

    /* Alt geçiş çubuğu */
    .mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 40;
        gap: 8px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        background: linear-gradient(to top, rgba(7, 9, 14, 0.96), rgba(7, 9, 14, 0.72));
        backdrop-filter: blur(12px);
    }

    .mob-btn {
        flex: 1;
        padding: 11px 6px;
        border-radius: 11px;
        border: 1px solid var(--panel-border);
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-secondary);
        font-family: var(--font-main);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }

    .mob-btn.active {
        background: rgba(0, 243, 255, 0.16);
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

    /* Fare yönergeleri dokunmatikte anlamsız; lisans atfı KALIR */
    .cyber-footer { position: fixed; bottom: 52px; left: 0; right: 0; padding: 0; background: none; border: none; }
    .footer-info { justify-content: center; }
    .footer-info > span:not(.attrib) { display: none; }
    .cyber-footer .attrib {
        border: none; padding: 0 12px;
        font-size: 8.5px; text-align: center; line-height: 1.3;
    }

    .floating-tooltip { max-width: 62vw; white-space: normal; font-size: 11px; }

    /* Quiz / simülasyon kartları çekmecelerin üstünde kalsın */
    .quiz-card, .bottom-panel { bottom: 96px; left: 12px; right: 12px; width: auto; max-width: none; }
}

@media (max-width: 400px) {
    .brand-text h1 { font-size: 11px; }
    .region-selector-grid { grid-template-columns: 1fr; }
}
