/* ==========================================================================
   TÜRKİYE TURNESİ - OTOBÜS SİMÜLASYONU STİL DOSYASI
   ========================================================================== */

:root {
    --bg-color: #08090c;
    --card-bg: rgba(15, 22, 36, 0.85);
    --primary: #ffb703; /* Trafik Kehribar Sarısı */
    --primary-glow: rgba(255, 183, 3, 0.45);
    --secondary: #00f5d4; /* Neon Turkuaz */
    --secondary-glow: rgba(0, 245, 212, 0.4);
    --danger: #ff4d4d;
    --danger-glow: rgba(255, 77, 77, 0.45);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   BACKGROUND CANVAS (YOL EFEKTİ)
   ========================================================================== */
#highway-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   SCREENS (Arayüz Panelleri)
   ========================================================================== */
.screen {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 520px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hidden {
    display: none !important;
}

.screen.hidden {
    opacity: 0;
    transform: scale(0.95);
}

#intro-screen {
    max-width: 600px;
    border-color: rgba(0, 245, 212, 0.2);
    box-shadow: 0 0 40px rgba(0, 245, 212, 0.1);
}

/* ==========================================================================
   TYPOGRAPHY & TITLES
   ========================================================================== */
.title-container {
    margin-bottom: 30px;
    position: relative;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    text-shadow: 0 0 20px var(--secondary-glow);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 1px;
}

.highlight-text {
    color: var(--primary);
    font-weight: 600;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* ==========================================================================
   LOGO & INTRO ANIMATIONS
   ========================================================================== */
.logo-glow-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--secondary), #0077b6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    z-index: 2;
    box-shadow: 0 0 30px var(--secondary-glow), inset 0 0 20px rgba(255,255,255,0.5);
    animation: floatLogo 4s ease-in-out infinite;
}

.logo-pulse-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    animation: ringPulse 2s linear infinite;
    z-index: 1;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes ringPulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.primary-btn {
    background: linear-gradient(135deg, var(--secondary), #00b4d8);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font-family);
    cursor: pointer;
    box-shadow: 0 10px 20px var(--secondary-glow);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px var(--secondary-glow);
}

.primary-btn:active {
    transform: translateY(1px);
}

.pulse-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* ==========================================================================
   MENUS & LISTS
   ========================================================================== */
.menu-list {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.menu-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    font-size: 1.5rem;
    margin-right: 20px;
    width: 30px;
    text-align: center;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.btn-text strong {
    font-weight: 600;
    margin-bottom: 4px;
}

.btn-text small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
}

.locked-route {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0,0,0,0.4);
}

.locked-route:hover {
    transform: none;
}

.locked-city {
    opacity: 0.6;
    background: rgba(255, 77, 77, 0.1);
    border-color: rgba(255, 77, 77, 0.3);
}

/* ==========================================================================
   KEYBOARD NAVIGATION FOCUS STYLES
   ========================================================================== */
.nav-focused {
    transform: translateX(10px) scale(1.05) !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 0 20px var(--secondary-glow), inset 0 0 10px var(--secondary-glow) !important;
    background: rgba(0, 245, 212, 0.15) !important;
    z-index: 50;
}

.primary-btn.nav-focused {
    transform: translateY(-3px) scale(1.05) !important;
}

.unlockable-city {
    background: rgba(0, 245, 212, 0.1);
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary-glow);
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px var(--secondary-glow); }
    50% { box-shadow: 0 0 20px var(--secondary-glow); }
}

/* ==========================================================================
   STATS & PROGRESS
   ========================================================================== */
.stats-panel {
    display: flex;
    width: 100%;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: auto;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}

.xp-bar-container {
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff9e00);
    width: 0%;
    transition: width 1s cubic-bezier(0.1, 0.9, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.xp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* ==========================================================================
   HUD & DRIVING VISUALS
   ========================================================================== */
.dashboard {
    display: flex;
    width: 100%;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

.dash-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.dash-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.dash-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary-glow);
}

.dash-value.stop-name {
    font-size: 1.5rem;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.dash-unit {
    font-size: 1rem;
    color: var(--text-muted);
}

.driving-visual {
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    border-radius: 16px;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
    perspective: 500px;
}

.lane-container {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%) rotateX(60deg);
    width: 300px;
    height: 600px;
    background: #334155;
    border-left: 5px solid #fff;
    border-right: 5px solid #fff;
    display: flex;
    justify-content: space-between;
}

.lane-line {
    width: 4px;
    height: 100%;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 40px, #fff 40px, #fff 80px);
    animation: scrollLines 0.5s linear infinite;
}

@keyframes scrollLines {
    from { background-position: 0 -80px; }
    to { background-position: 0 0; }
}

.bus {
    position: absolute;
    bottom: 50px;
    font-size: 3rem;
    transition: left 0.3s ease;
    text-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 20;
}

.lane-1 { left: 10%; transform: translateX(-50%); }
.lane-2 { left: 50%; transform: translateX(-50%); }
.lane-3 { left: 90%; transform: translateX(-50%); }

.warning-text {
    margin-top: 20px;
    color: var(--danger);
    font-weight: 800;
    font-size: 1.2rem;
    min-height: 30px;
    animation: flash 1s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.toast {
    background: var(--card-bg);
    border-left: 4px solid var(--secondary);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: #fff;
    font-family: var(--font-family);
    font-weight: 600;
    animation: slideIn 0.3s ease forwards;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Global Progress Bar (Overpass API Loading) */
#global-progress {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border);
    z-index: 9999;
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

#global-progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}
