/* main.css - Main styling for Racing Destiny */

/* ===== GENERAL STYLES ===== */
:root {
    --primary-color: #ff0000;
    --secondary-color: #1a1a1a;
    --accent-color: #ffcc00;
    --text-color: #ffffff;
    --background-color: #0a0a0a;
    --racing-red: #e60000;
    --racing-blue: #0066cc;
    --racing-green: #00cc66;
    --racing-yellow: #ffcc00;
    --gradient-dark: linear-gradient(to bottom, #222222, #000000);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.4;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.game-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--gradient-dark);
    z-index: 1;
}

.game-section.active {
    display: flex;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.section-header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.section-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.game-button {
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(230, 0, 0, 0.4);
    margin-top: 20px;
}

.game-button:hover {
    background: #ff3333;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230, 0, 0, 0.6);
}

.game-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(230, 0, 0, 0.3);
}

.button-text {
    position: relative;
    z-index: 2;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
    background: #000000;
    z-index: 100;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.checkered-flag {
    width: 60px;
    height: 60px;
    background-image: url('../images/checkered-flag.png');
    background-size: contain;
    background-repeat: no-repeat;
    animation: waveFlag 2s infinite;
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin: 20px 0;
    letter-spacing: 3px;
}

.loading-bar {
    width: 300px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 10px;
    transition: width 3s ease;
}

/* ===== WELCOME SCREEN ===== */
.game-title {
    font-size: 4rem;
    margin-bottom: 10px;
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.7);
}

.game-subtitle {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--accent-color);
}

.intro-container {
    margin-bottom: 30px;
}

.intro-container p {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.name-input-container {
    margin: 20px 0;
}

.name-input-container label {
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
}

#player-name {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--racing-red);
    padding: 12px;
    width: 100%;
    max-width: 400px;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-color);
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    border-radius: 4px;
}

#player-name:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.rev-counter {
    width: 200px;
    height: 100px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 100px 100px 0 0;
    position: relative;
    margin-top: 30px;
    border: 2px solid #333;
    overflow: hidden;
}

.rev-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 80px;
    background: var(--accent-color);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-90deg);
    transition: transform 0.3s ease;
}

.racing-lights {
    display: flex;
    margin-top: 40px;
}

.light {
    width: 30px;
    height: 30px;
    background: #333;
    border-radius: 50%;
    margin: 0 10px;
    transition: background-color 0.3s ease;
}

/* ===== DRIVER SELECTION ===== */
.drivers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

.driver-option {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.driver-option:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.driver-image {
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.driver-option h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--racing-red);
}

.driver-option p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    min-height: 60px;
}

.select-button {
    background: var(--racing-blue);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-button:hover {
    background: #0077e6;
    transform: scale(1.05);
}

/* ===== CIRCUIT SELECTION ===== */
.circuits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

.circuit-option {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.circuit-option:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.circuit-image {
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 5px;
}

.circuit-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.circuit-option:hover .circuit-image img {
    transform: scale(1.1);
}

.circuit-option h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--racing-green);
}

.circuit-option p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    min-height: 60px;
}

/* ===== RACE DECISIONS ===== */
.race-simulation {
    width: 100%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    position: relative;
}

.race-animation {
    width: 100%;
    height: 200px;
    background: #111;
    border-radius: 5px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    background-image: url('https://images.pexels.com/photos/12920521/pexels-photo-12920521.jpeg');
    background-size: cover;
    background-position: center;
}


.track-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: url('../images/track-background.png') repeat-x;
    animation: trackMove 10s linear infinite;
}

.player-car {
    position: absolute;
    bottom: 30px;
    left: 50px;
    width: 60px;
    height: 30px;
    background: url('../images/player-car.png') no-repeat;
    background-size: contain;
}

.opponent-cars {
    position: absolute;
    width: 100%;
    height: 100%;
}

.decision-point {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--racing-yellow);
    display: none;
}

.decision-point.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.decision-point h3 {
    color: var(--racing-yellow);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.decision-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.decision-option {
    background: rgba(50, 50, 70, 0.7);
    border: none;
    color: white;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 8px;
    border-left: 2px solid transparent;
}

.decision-option:hover {
    background: rgba(70, 70, 90, 0.9);
    border-left: 2px solid #ffcc00;
}

/* ===== PIT STOP INTERVIEW ===== */
.interview-container {
    width: 100%;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.interviewer {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.interviewer-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
}

.interviewer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.interview-questions {
    width: 100%;
}

.question-container {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: none;
}

.question-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.question-container h3 {
    margin-bottom: 15px;
    color: var(--racing-blue);
    font-size: 1.2rem;
}

.interview-answer {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    border-radius: 4px;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
   margin-bottom: 10px;
}

.interview-answer:focus {
    border-color: var(--racing-blue);
    outline: none;
}

.answer-button {
    background: var(--racing-blue);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer-button:hover {
    background: #0077e6;
}

.interview-timer {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
}

.timer-count {
    color: var(--racing-red);
}

/* ===== CHAMPIONSHIP FINAL ===== */
.championship-animation {
    width: 100%;
    max-width: 1000px;
    height: 400px;
    position: relative;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
}

.final-race-sequence {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.race-track {
    position: absolute;
    width: 200%;
    height: 100%;
    background: url('../images/final-track.png') repeat-x;
    animation: finalTrackMove 8s linear infinite;
}

.finish-line {
    position: absolute;
    right: -200px;
    top: 0;
    width: 50px;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        black,
        black 20px,
        white 20px,
        white 40px
    );
    animation: finishLineAppear 5s linear forwards;
    animation-delay: 5s;
}

.victory-sequence {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.checkered-flag {
    width: 100px;
    height: 100px;
    background-image: url('../images/checkered-flag.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: bigWaveFlag 1.5s infinite;
    margin-bottom: 20px;
}

.victory-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.7);
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/confetti.png');
    pointer-events: none;
    z-index: 10;
}

.podium-sequence {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.podium-platform {
    width: 300px;
    height: 150px;
    background-image: url('../images/podium.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 20px;
}

.trophy {
    width: 100px;
    height: 120px;
    background-image: url('../images/trophy.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: trophyGlow 2s infinite;
}

.celebration-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--racing-gold);
    margin-top: 20px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
}

/* ===== BIRTHDAY REVEAL ===== */
.reveal-transition {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: black;
    z-index: 10;
}

.glitch-effect {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: url('../images/glitch.png');
    opacity: 0.3;
    animation: glitch 0.3s steps(1) infinite;
}

.system-message {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--racing-red);
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
}

.reveal-message {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: white;
}

.birthday-message {
    max-width: 800px;
    width: 100%;
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.3);
    display: none;
}

.birthday-header {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 30px;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
}

.message-container {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: left;
}

.signature {
    font-style: italic;
    margin-top: 30px;
}

.signature-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--racing-red);
    margin-top: 10px;
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* ===== ANIMATIONS ===== */
@keyframes waveFlag {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

@keyframes bigWaveFlag {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

@keyframes trackMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes finalTrackMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes finishLineAppear {
    0% { right: -200px; }
    100% { right: 50px; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glitch {
    0% { background-position: 0 0; }
    20% { background-position: -20px -20px; }
    40% { background-position: 20px 20px; }
    60% { background-position: 20px -20px; }
    80% { background-position: -20px 20px; }
    100% { background-position: 0 0; }
}

@keyframes trophyGlow {
    0% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9)); }
    100% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
}

/* Additional Variables */
:root {
    --racing-gold: #ffd700;
}