:root {
    --header-bg-color-light: #004b87;
    --header-bg-color-dark: #003366;
    --button-bg-color-light: #007bff;
    --button-bg-color-dark: #0056b3;
    --nav-bg-color-light: #007bff;
    --nav-bg-color-dark: #0056b3;
    --preview-bar-bg-color-light: #f8f9fa;
    --preview-bar-bg-color-dark: #2c2c2c;
    --banner-bg-image: url('Resources/F-15EX.jpg');
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    transition: background 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    /* Ensure no horizontal overflow */
}

body.light-theme {
    background: #f0f0f0;
    color: #333;
    --preview-bar-bg-color: var(--preview-bar-bg-color-light);
    --form-bg-color: #ffffff;
    --form-text-color: #333333;
    --form-border-color: #cccccc;
    --form-label-color: #004b87;
    --input-border-color: #cccccc;
    --input-border-focus-color: #007bff;
}

body.dark-theme {
    background: #333;
    color: #f0f0f0;
    --preview-bar-bg-color: var(--preview-bar-bg-color-dark);
    --form-bg-color: #2c2c2c;
    --form-text-color: #f0f0f0;
    --form-border-color: #444444;
    --form-label-color: #f0f0f0;
    --input-border-color: #444444;
    --input-border-focus-color: #007bff;
}

html,
body {
    overflow-x: hidden;
    /* Ensure no horizontal overflow */
}

/* Header */
header {
    background: var(--header-bg-color-light);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: background 0.3s;
}

body.dark-theme header {
    background: var(--header-bg-color-dark);
}

/* Navigation Bar */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--nav-bg-color-light);
    padding: 10px;
    transition: background 0.3s, top 0.3s;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    /* Allow horizontal scrolling */
}

body.dark-theme nav {
    background: var(--nav-bg-color-dark);
}

nav .nav-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    white-space: nowrap;
    /* Prevent line breaks between links */
}

nav a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    padding: 10px;
    transition: background 0.3s ease;
    font-size: 14px;
    display: inline-block;
    /* Ensure links remain inline */
}

nav a:hover {
    background: var(--button-bg-color-dark);
    border-radius: 4px;
}

nav button {
    background: var(--button-bg-color-dark);
    /* Dark theme color when in light theme */
    color: white;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    font-size: 12px;
    /* Slightly smaller font size for the button */
    white-space: nowrap;
    /* Prevent the button from breaking into multiple lines */
    flex-shrink: 0;
    /* Prevent the button from shrinking */
    margin-left: auto;
    /* Push the button to the right side */
}

nav button:hover {
    background: var(--button-bg-color-light);
    /* Light theme color on hover */
    color: white;
    /* Ensure text remains white */
}

body.dark-theme nav button {
    background: var(--button-bg-color-light);
    /* Light theme color when in dark theme */
    color: white;
    /* Ensure text remains white */
}

body.dark-theme nav button:hover {
    background: var(--button-bg-color-dark);
    /* Dark theme color on hover */
    color: white;
    /* Ensure text remains white */
}

/* Sticky Navigation */
.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* Banner */
.banner {
    background: var(--banner-bg-image) no-repeat center center;
    background-size: cover;
    color: white;
    text-align: center;
    padding: 30px 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    transition: background 0.3s, filter 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 30vh;
    /* Adjusted height for smaller screens */
    min-height: 200px;
    /* Ensure a minimum height */
    filter: brightness(1);
    /* Default brightness */
}

body.dark-theme .banner {
    filter: brightness(0.7);
    /* Darker in dark theme */
}

.banner h1 {
    font-size: 1.5em;
}

.banner p {
    font-size: 1em;
}

@media (min-width: 768px) {
    .banner {
        height: 40vh;
        /* Increase height for medium screens */
    }

    .banner h1 {
        font-size: 2.5em;
    }

    .banner p {
        font-size: 1.2em;
    }
}

@media (min-width: 1024px) {
    .banner {
        height: 50vh;
        /* Increase height for larger screens */
    }

    .banner h1 {
        font-size: 3em;
    }

    .banner p {
        font-size: 1.5em;
    }
}

@media (min-width: 1440px) {
    .banner {
        height: 60vh;
        /* Further increase height for very large screens */
    }

    .banner h1 {
        font-size: 4em;
    }

    .banner p {
        font-size: 1.8em;
    }
}

/* Content */
.content {
    flex: 1;
    /* Ensures content takes the available space */
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 60px;
    /* Adjust based on the height of the nav bar */
}

/* Form Container */
.form-container {
    width: 100%;
    max-width: 500px;
    /* Adjust this as needed */
    margin: 0 auto;
    padding: 20px;
    background-color: var(--form-bg-color);
    border: 1px solid var(--form-border-color);
    border-radius: 8px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
}

body.dark-theme .form-container {
    background-color: var(--form-bg-color-dark);
    border-color: var(--form-border-color-dark);
}

#signup-form {
    display: flex;
    flex-direction: column;
}


/* Adjustments for small screens */
@media (max-width: 768px) {

    #signup-form,
    .form-container {
        width: 90%;
        padding: 15px;
    }
}


/* Sign Up Page Description */
.description {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3em;
    color: #333;
}

.alternate-signup {
    text-align: center;
    margin-top: 20px;
}

.alternate-signup p {
    font-size: 1em;
    color: #007bff;
}

body.dark-theme .description {
    color: #f0f0f0;
}

.alternate-signup a {
    color: var(--button-bg-color-light);
    text-decoration: none;
    font-weight: bold;
}

.alternate-signup a:hover {
    color: var(--button-bg-color-dark);
}

body.dark-theme .alternate-signup p {
    color: #f0f0f0;
}

body.dark-theme .alternate-signup a {
    color: #f0f0f0;
}

body.dark-theme .alternate-signup a:hover {
    color: #cccccc;
}



/* Label Styling */
#signup-form label {
    margin-bottom: 5px;
    color: var(--form-label-color);
}

/* Input Field Styling */
#signup-form input {
    width: 100%;
    /* Make the input field full width */
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid var(--input-border-color);
    font-size: 1em;
    box-sizing: border-box;
    /* Include padding and border in the element's width and height */
    background-color: var(--form-bg-color);
    color: var(--form-text-color);
}

#signup-form input:focus {
    border-color: var(--input-border-focus-color);
    outline: none;
}

/* Button Styling */
#signup-form button {
    background-color: var(--button-bg-color-light);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    width: 100%;
    /* Make the button full width */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    /* Add some space above the button */
    box-sizing: border-box;
    /* Include padding and border in the button's width */
}

#signup-form button:hover {
    background-color: var(--button-bg-color-dark);
    box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.15);
}

/* Success Popup Styles */
#success-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--popup-bg-color);
    border: 1px solid var(--popup-border-color);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    color: var(--popup-text-color);
}

#success-popup h3,
a {
    margin: 0 0 10px;
    color: var(--popup-heading-color);
}

#success-popup .popup-footer {
    display: flex;
    justify-content: flex-end;
}

#close-success-popup {
    background-color: var(--button-bg-color-light);
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

/* Validation Message Styles */
.validation-message {
    color: red;
    font-size: 1em;
    margin-left: 2%;
    margin-top: 1vh;
}

.invalid {
    border-color: red;
}

/* Adapt the form to the theme */
body.light-theme #success-popup {
    --popup-bg-color: #ffffff;
    --popup-text-color: #333333;
    --popup-border-color: #cccccc;
    --popup-heading-color: #004b87;
}

body.dark-theme #success-popup {
    --popup-bg-color: #2c2c2c;
    --popup-text-color: #f0f0f0;
    --popup-border-color: #444444;
    --popup-heading-color: #007bff;
}

/* HFS Links */
.hfs-links {
    display: flex;
    flex-wrap: wrap;
    /* Allow the buttons to wrap to a new line */
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.hfs-link {
    background: var(--button-bg-color-light);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, background 0.3s;
    width: calc(100% - 30px);
    /* Responsive width, adjusts based on container */
    max-width: 300px;
    text-align: center;
    flex: 1 1 45%;
    /* Allow buttons to take up about 45% width, adjust as needed */
}

.hfs-link:hover {
    background: var(--button-bg-color-dark);
    transform: scale(1.05);
}

.hfs-link-content {
    padding: 20px;
}

.hfs-link h2 {
    margin: 0;
    font-size: 1.5em;
}

.hfs-link p {
    margin: 5px 0 0;
}

body.dark-theme .hfs-link {
    background: var(--button-bg-color-dark);
}

/* Media Player Container */
.media-player {
    position: fixed;
    top: 50px;
    /* Height of the sticky navigation bar */
    bottom: 60px;
    /* Height of the sticky preview bar */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    /* Center the media horizontally */
    align-items: center;
    /* Center the media vertically */
    background-color: var(--frame-bg-color);
    overflow: hidden;
    /* Prevent overflow */
    box-sizing: border-box;
    /* Ensure padding/border are included in width/height */
    z-index: 1000;
    /* Ensure it's above other content but below the nav and preview buttons */
    margin: 0;
}

/* Media Container */
.media-container {
    width: 100%;
    /* Full width of the media player */
    height: 100%;
    /* Full height of the media player */
    max-width: 100%;
    /* Ensure media fits within the player width */
    max-height: 100%;
    /* Ensure media fits within the player height */
    object-fit: contain;
    /* Maintain aspect ratio */
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Navigation Buttons */
.nav-button {
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 50%;
    /* Center vertically relative to the media player */
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    opacity: 0.7;
    z-index: 1100;
    /* Ensure arrows are above other elements */
    transition: opacity 0.3s ease;
}

.nav-button img {
    width: 100%;
    height: auto;
    display: block;
}

.nav-button:hover {
    opacity: 1;
    /* Increase opacity on hover */
}

#prev-button {
    left: 10px;
    /* Position to the left edge of the media player */
}

#next-button {
    right: 10px;
    /* Position to the right edge of the media player */
}

/* Preview Bar */
.preview-bar-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 75vw;
    /* Match the media frame width */
    margin: 20px auto;
    position: relative;
    padding: 0 10px;
    /* Reduce padding to better align the bar */
    overflow: hidden;
    /* Prevent content overflow */
}

.preview-bar {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 10px 0;
    flex: 1;
    scrollbar-width: none;
    /* Hide scrollbar on Firefox */
}

.preview-bar::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar on Chrome, Safari, and Opera */
}

.preview-thumbnail {
    width: 60px;
    /* Smaller size for better fit */
    height: 45px;
    margin: 0 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 2px solid transparent;
    border-radius: 5px;
}

.preview-thumbnail:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

/* Preview Arrow Buttons */
.nav-button.preview-nav {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 40px;
    /* Adjust size for better alignment */
    height: 10px;
    opacity: 0.5;
    /* Adjust transparency */
    transition: opacity 0.3s ease;
}

.nav-button.preview-nav:hover {
    opacity: 0.8;
    /* Slightly less transparent on hover */
}

.nav-button img {
    width: 100%;
    /* Ensure icon fills the button */
    height: auto;
}

/* Specific Page Customizations */

/* Hide header */
.page-specific-header {
    display: none;
    /* Hide the header */
}

/* Navigation bar always sticky at the top */
.page-specific-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* Preview bar sticky at the bottom */
.page-specific-preview-bar-container {
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--preview-bar-bg-color);
    /* Automatically switch with the theme */
    transition: background-color 0.3s ease;
}

/* Hide footer */
.page-specific-footer {
    display: none;
    /* Hide the footer */
}

/* Prevent scrolling on this specific page */
.page-specific {
    overflow: hidden;
    /* Disable scrolling */
    height: 100vh;
    /* Ensure the body takes up the full viewport height */
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Animation for Media Switching */
.media-container img,
.media-container video {
    opacity: 0;
    transition: opacity 0.5s ease;
    max-width: 100%;
    /* Ensure media fits within the frame */
    max-height: 100%;
    /* Ensure media fits within the frame */
}

.media-container img.show,
.media-container video.show {
    opacity: 1;
}


/* About Page Styles */

/* Introduction Section */
.intro {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
}

.intro h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.intro p {
    font-size: 1.2em;
    color: #666;
}

/* Gaming Highlights Section */
.gaming-highlights {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 1000px;
}

.gaming-highlights h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.game-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.game-item {
    background-color: var(--frame-bg-color);
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.game-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.game-item h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
    min-height: 50px;
    /* Ensures all headers have the same height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: color 0.3s ease;
}

.game-item p {
    font-size: 1em;
    color: #777;
    flex-grow: 1;
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0;
    /* Remove margin to avoid spacing issues */
    transition: color 0.3s ease;
}

.game-item:hover {
    transform: scale(1.05);
    background-color: var(--header-bg-color-light);
    color: white;
    /* Ensure all text changes to white */
}

.game-item:hover h3,
.game-item:hover p {
    color: white;
    /* Change text color to white on hover */
}

body.dark-theme .game-item {
    background-color: var(--frame-bg-color-dark);
}

body.dark-theme .game-item h3 {
    color: #f0f0f0;
    /* Set default color for h3 in dark theme */
}

body.dark-theme .game-item p {
    color: #ccc;
    /* Set default color for p in dark theme */
}

body.dark-theme .game-item:hover {
    background-color: var(--header-bg-color-dark);
    color: white;
    /* Ensure all text changes to white */
}

body.dark-theme .game-item:hover h3,
body.dark-theme .game-item:hover p {
    color: white;
    /* Change text color to white on hover */
}

/* Gaming Setup Section */
.gaming-setup {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 800px;
}

.gaming-setup h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

.gaming-setup p {
    font-size: 1.2em;
    color: #666;
}

/* Gallery Section */
.gallery {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 1000px;
}

.gallery h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.gallery-grid img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.1);
}

/* Contact Page Styles */

/* Contact Form */
.contact-form {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
}

.contact-form h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    text-align: left;
}

body.dark-theme .contact-form label {
    color: #f0f0f0;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
}

body.dark-theme .contact-form input,
body.dark-theme .contact-form textarea {
    background-color: #2c2c2c;
    border: 1px solid #444;
    color: #f0f0f0;
}

.contact-form button {
    padding: 10px 20px;
    background-color: var(--button-bg-color-light);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-form button:hover {
    background-color: var(--button-bg-color-dark);
}

body.dark-theme .contact-form button {
    background-color: var(--button-bg-color-dark);
}

body.dark-theme .contact-form button:hover {
    background-color: var(--button-bg-color-light);
}

/* Other Contact Methods */
.other-contact {
    text-align: center;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
}

.other-contact h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.other-contact ul {
    list-style: none;
    padding: 0;
}

.other-contact li {
    font-size: 1.2em;
    margin: 10px 0;
}

.other-contact a {
    color: var(--button-bg-color-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.other-contact a:hover {
    color: var(--button-bg-color-dark);
}

body.dark-theme .other-contact a {
    color: var(--button-bg-color-dark);
}

body.dark-theme .other-contact a:hover {
    color: var(--button-bg-color-light);
}

/* Error Popup */
#error-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--popup-bg-color);
    color: var(--popup-text-color);
    border: 1px solid var(--popup-border-color);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-radius: 10px;
    max-width: 400px;
    text-align: center;
}

#error-popup h3 {
    margin: 0 0 10px;
    font-size: 1.5em;
    color: var(--popup-heading-color);
}

#error-popup p {
    margin: 0 0 20px;
    font-size: 1em;
    color: var(--popup-text-color);
}

#error-popup .popup-footer {
    display: flex;
    justify-content: flex-end;
}

#close-popup {
    background-color: var(--button-bg-color-light);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

#close-popup:hover {
    background-color: var(--button-bg-color-dark);
}

/* Footer */
.footer {
    background: var(--header-bg-color-light);
    color: white;
    text-align: center;
    transition: background 0.3s;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

body.dark-theme .footer {
    background: var(--header-bg-color-dark);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.2em;
    }

    header button {
        padding: 8px 10px;
        font-size: 12px;
    }

    nav a {
        font-size: 12px;
        padding: 8px;
        margin: 0 5px;
    }

    .banner {
        padding: 20px 10px;
    }

    .banner h1 {
        font-size: 1.5em;
    }

    .banner p {
        font-size: 1em;
    }

    .hfs-link {
        width: calc(100% - 20px);
        /* Adjusted for smaller screens */
        max-width: 100%;
    }

    .footer {
        padding: 8px 10px;
    }
}

input.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

body.light-theme .validation-message {
    color: #e74c3c;
}

body.dark-theme .validation-message {
    color: #e74c3c;
}

body.light-theme input.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

body.dark-theme input.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

#option.dark-theme {
    background: #333;
}