/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #0b0b0d;
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Horizontal padding for spacing */
    background: rgba(0, 0, 0, 0.7);
    position: fixed;
    width: 100%;
    height: 60px; /* Fixed header height */
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Matches the header height for alignment */
}

.header .logo img {
    height: 80px; /* Explicitly set a small logo size */
    width: auto; /* Maintain aspect ratio */
    display: block; /* Prevent extra whitespace */
}

.header-buttons {
    display: flex;
    gap: 15px;
}

/* Header Button Animation */
.header-button {
    color: #fff;
    background: #ff1e1e;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);
    animation: buttonLoad 0.6s ease-in-out forwards;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, font-size 0.3s ease;
}

.header-button:nth-child(1) {
    animation-delay: 0.2s;
}

.header-button:nth-child(2) {
    animation-delay: 0.4s;
}


/* Button Loading Animation */
@keyframes buttonLoad {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero {
    background: url('images/f1-track.jpg') center/cover no-repeat;
    min-height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 60px; /* Push content below fixed header */
    overflow: hidden;
    z-index: 0;
}

.hero::before {
    content: '';
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8));
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}


/* Animation for Hero Content */
.hero h1 {
    font-size: 48px;
    font-family: 'Orbitron', sans-serif;
    color: #ff1e1e;
    margin-bottom: 20px;
    opacity: 0; /* Start invisible */
    transform: translateY(30px) scale(0.9); /* Slide up and scale */
    animation: heroFadeIn 1s ease-in-out forwards;
    animation-delay: 0.3s;
}

@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1s ease-in-out forwards;
    animation-delay: 0.5s;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1s ease-in-out forwards;
    animation-delay: 0.7s;
}

/* Hero Button Animation */
.hero-buttons .cta-button {
    display: inline-block;
    background: #ff1e1e;
    color: #fff;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px;
    font-size: 16px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, font-size 0.3s ease;
}


/* General styling for Select2 dropdown */
.select2-container .select2-selection--single {
    height: 48px;
    border: 1px solid #e10600;
    border-radius: 5px;
    background-color: #111;
    color: #e10600;
    padding: 8px;
    font-size: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    color: #e10600;
    line-height: 30px;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 48px;
    color: #e10600;
}

.select2-container--open .select2-selection--single {
    border-color: #ff4500;
    box-shadow: 0 3px 6px rgba(255, 69, 0, 0.5);
}

/* Dropdown styling */
.select2-dropdown {
    background-color: #111;
    color: #fff;
    border-radius: 5px;
    border: 1px solid #e10600;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.select2-dropdown .select2-results__option {
    padding: 10px;
    background-color: #222;
    color: #fff;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.select2-dropdown .select2-results__option:hover {
    background-color: #333;
}

.select2-dropdown .select2-results__option[aria-selected="true"] {
    background-color: #e10600;
    color: #fff;
}

/* Placeholder text styling */
.select2-container .select2-selection__placeholder {
    color: #777;
}




/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-buttons .cta-button {
        width: 100%;
        max-width: 280px;
    }
    /* Reduce logo size */
    .header .logo img {
        height: 40px;
        margin-left: -15px;
    }

    /* Stack buttons vertically */
    .header-buttons {
        flex-direction: column; /* Stack buttons */
        gap: 10px; /* Reduce spacing */
    }

    .header-button {
        padding: 8px 15px; /* Smaller buttons */
        font-size: 14px;
    }
    .table-container {
        margin-bottom: 20px;
    }

    table {
        font-size: 0.9em; /* Reduce font size for better readability on small screens */
        width: 100%; /* Ensure table fits within the container */
    }

    thead th {
        font-size: 0.9em; /* Reduce header font size */
        padding: 8px; /* Reduce padding for smaller screens */
    }

    td {
        padding: 8px; /* Reduce cell padding */
        font-size: 0.85em; /* Smaller text for mobile */
    }
    /* Content container adjustments */
    .container.content {
        padding: 15px; /* Reduce padding */
    }

    /* Race selection adjustments */
    .race-selection {
        margin: 15px 0;
    }

    .race-selection label {
        font-size: 1em; /* Reduce font size for mobile */
    }

    .race-selection select {
        padding: 8px; /* Compact dropdown */
        font-size: 1em;
    }
    .select2-container .select2-selection--single {
        font-size: 0.9rem;
        height: 40px;
    }
    .prediction-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-group {
        width: 100%;
    }

    .race-selection select {
        font-size: 0.9rem;
        max-width: 100%;
    }

    .table-container table {
        font-size: 0.9rem;
    }

    .points-section {
        font-size: 1rem;
    }



}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 14px;
    }

    .hero-buttons .cta-button {
        font-size: 14px;
        padding: 12px 20px;
    }


    /* Adjust button size and alignment */
    .header-buttons {
        gap: 8px;
    }

    .header-button {
        font-size: 12px;
        padding: 6px 12px;
    }
    .header-buttons {
        flex-direction: column;
        align-items: center;
    }
    .header-buttons {
        flex-direction: row !important;
        gap: 8px;
        justify-content: center;
        align-items: center;
    }

    .race-selection select {
        font-size: 0.85rem;
        padding: 8px;
    }

    form label {
        font-size: 0.9rem;
    }

    form select,
    form button {
        font-size: 0.85rem;
        padding: 8px;
    }

    .table-container table {
        font-size: 0.85rem;
    }

    .points-section h3 {
        font-size: 1.2rem;
    }

    .points-section p {
        font-size: 1rem;
    }
}

/* Hover functionality for larger devices */
@media (min-width: 769px) {
    .header-button:hover {
        background: #ff3f3f;
        color: #000;
        transform: scale(1.1);
        font-size: 16px;
    }

    .hero-buttons .cta-button:hover {
        background: #ff3f3f;
        color: #000;
        transform: scale(1.1);
        font-size: 18px;
    }
}
