@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00ffff;
    --secondary-color: #ff00ff;
    --accent-color: #ffff00;
    --bg-color: #121212;
    --panel-color: rgba(20, 20, 30, 0.8);
    --text-color: #ffffff;
    --menu-transition: 0.3s ease-in-out;
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 1s ease-in-out;
}

.logo {
    text-align: center;
    margin-bottom: 50px;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 60px;
    font-weight: 900;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    letter-spacing: 2px;
}

.logo h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 30px;
    font-weight: 500;
    color: var(--accent-color);
    letter-spacing: 8px;
}

.loading-bar-container {
    width: 500px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 15px var(--primary-color);
}

.loading-text {
    font-size: 18px;
    color: var(--text-color);
    opacity: 0.8;
}

/* Menu Styles */
.menu-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    perspective: 1000px;
}

.menu {
    background-color: var(--panel-color);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 40px 60px;
    min-width: 400px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    transform-style: preserve-3d;
    transform: translateZ(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.menu-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 40px;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
}

.menu-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--accent-color);
    letter-spacing: 5px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-option {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    padding: 15px 30px;
    text-align: center;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--menu-transition);
    position: relative;
    overflow: hidden;
}

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

.menu-option:hover {
    background-color: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.menu-option:hover:before {
    left: 100%;
}

/* Sub Menus */
.sub-menu {
    background-color: var(--panel-color);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px;
    min-width: 600px;
    max-width: 80%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;
    z-index: 20;
}

.sub-menu.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.sub-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

.sub-menu-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    color: var(--primary-color);
}

.back-button {
    font-family: 'Orbitron', sans-serif;
    padding: 8px 20px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-button:hover {
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Play Menu */
.race-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.race-mode {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.race-mode:hover {
    background-color: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.race-mode h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.race-mode p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Garage Menu */
.garage-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.car-selection {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.car-option {
    font-family: 'Orbitron', sans-serif;
    padding: 10px 25px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.car-option:hover, .car-option.selected {
    background-color: rgba(0, 255, 255, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.customization-tabs {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    margin-bottom: 20px;
}

.tab {
    font-family: 'Orbitron', sans-serif;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab:hover, .tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.customization-options {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid transparent;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.color-option.selected {
    border-color: var(--text-color);
}

/* Settings Menu */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.settings-section {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
}

.settings-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 5px;
}

.setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

.setting span {
    font-size: 16px;
}

.setting select, .setting input[type="range"] {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    min-width: 150px;
}

.setting input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    outline: none;
}

.setting input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.setting input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* Animations and effects */
@keyframes neonPulse {
    0% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    }
    50% {
        text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
    100% {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    }
}

@keyframes bgGlow {
    0% {
        box-shadow: 0 0 10px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
    100% {
        box-shadow: 0 0 10px var(--primary-color);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 40px;
    }
    
    .logo h2 {
        font-size: 20px;
    }
    
    .loading-bar-container {
        width: 300px;
    }
    
    .menu {
        min-width: 300px;
        padding: 30px;
    }
    
    .sub-menu {
        min-width: 90%;
        max-width: 90%;
    }
    
    .race-modes {
        grid-template-columns: 1fr;
    }
    
    .color-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

