/* =========================================================
   Global Styles
   ========================================================= */

/* --- Custom Font Declaration --- */
@font-face {
    font-family: "Bomber Escort Condensed Italic";
    src: url('../fonts/BomberEscort.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

/* --- Google Font Import --- */
/* Exo 2 for headings and Montserrat for body text, defining the site\'s typography. */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;700&family=Montserrat:wght@400;500;700&display=swap');

/* --- CSS Variables (Color Palette & Fonts) --- */
/* Centralized variables for consistent branding and easy theme updates. */
:root {
    /* TGM Brand Palette (Corrected) */
    --tgm-purple: #6A39A6;
    --tgm-dark: #211D3B;
    --tgm-green: #01F5BB; /* Official name is Bright Cyan */
    --tgm-red-error: #e74c3c; /* Standard error red */

    /* Secondary & Utility Colors */
    --tgm-light: #F5F5F5;
    --tgm-grey: #333333;
    --tgm-dark-purple: #3F008C;
    --tgm-dark-green: #304639;

    /* Semantic Mapping */
    --background-color: var(--tgm-dark);
    --content-bg: #1E1E1E;
    --text-primary: var(--tgm-light);
    --text-secondary: #a0a0a0;
    --border-color: var(--tgm-grey);
    --accent-purple: var(--tgm-purple);
    --accent-purple-hover: #522c83; /* Derived from new purple */

    /* Typography (Corrected) */
    --font-heading: "Bomber Escort Condensed Italic", sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

/* --- General Body & Reset Styles --- */
/* Basic resets and default styles for the entire site. */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: normal; /* Custom fonts often don't need bold */
}

p {
    margin-bottom: 15px;
}

/* --- UPDATED: Code Block Styling --- */
code {
    font-family: 'Courier New', Courier, monospace;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 1.1em; /* Increased size to match body text */
    color: var(--tgm-green); /* Highlight code in brand color */
}

a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--accent-purple-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Shared Component: Header & Navigation --- */
header {
    background-color: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.auth-status {
    min-width: 180px; /* Reserve space to prevent layout shift */
    text-align: right; /* Ensure content aligns nicely to the right */
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    padding: 5px;
}

.logo img {
    height: 70px;
    width: auto;
}

.logo h1 {
    font-size: 1.5em;
    margin: 0;
    color: var(--text-primary);
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

header nav a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1em;
    text-decoration: none;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

header nav a:hover,
header nav a.active {
    color: var(--text-primary);
    border-bottom-color: var(--tgm-green);
}

/* --- Dropdown Menu Styles --- */
.dropdown-container {
    position: relative;
}

.dropdown-trigger {
    cursor: pointer;
    padding-right: 15px; /* Space for the arrow */
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    min-width: 160px;
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 10px 0;
    z-index: 1000;
}

/* Show dropdown on hover */
.dropdown-container:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: none; /* Remove underline from main nav style */
    transition: background-color 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background-color: var(--accent-purple);
    color: white;
}

/* --- Shared Component: Main Content Area --- */
main {
    padding: 40px 0;
}

/* --- Shared Component: Footer --- */
footer {
    background-color: var(--content-bg);
    color: var(--text-secondary);
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

/* Apply flexbox to the top row containing nav and logo */
.footer-top-row {
    display: flex;
    justify-content: space-between; /* Puts space between nav and logo */
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    gap: 20px; /* Adds space if they wrap */
    margin-bottom: 15px; /* Space between top row and copyright */
}

/* Style the logo within its container */
.footer-logo-container img {
    height: 50px;
    width: auto;
    display: block;
}

/* Center the copyright text */
.footer-copyright {
    text-align: center;
    font-size: 0.9em;
}

/* Styles for the navigation links within the footer */
.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 0;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.footer-nav a:hover {
    color: var(--text-primary);
}

/* --- Utility Classes --- */
.hidden {
    display: none !important;
}

/* =========================================================
   --- Shared Page Header Styles ---
   ========================================================= */

.page-header {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--content-bg);
    border-radius: 12px;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 3em;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.2em;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    text-align: left; /* ADDED: For better readability of descriptions */
}

/* =========================================================
   --- Home Page (index.html) Styles ---
   ========================================================= */

.hero {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--content-bg);
    border-radius: 12px;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 3em;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2em;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: left;
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 40px;
}

/* =========================================================
   --- Browse Games Page (browse-games.html) Styles ---
   ========================================================= */

/* --- Styles for Genre Rows (Browse View) --- */
.genre-row {
    margin-bottom: 50px;
}

.genre-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.genre-header h3 {
    font-size: 1.8em;
    margin: 0;
}

.genre-header a {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-secondary);
}

.game-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 25px;
    padding: 20px 15px;
    margin: 0 -15px; 
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--accent-purple) var(--content-bg); /* Firefox */
}

/* Custom scrollbar for Webkit browsers (Chrome, Safari) */
.game-carousel::-webkit-scrollbar {
    height: 8px;
}
.game-carousel::-webkit-scrollbar-track {
    background: var(--content-bg);
    border-radius: 4px;
}
.game-carousel::-webkit-scrollbar-thumb {
    background-color: var(--accent-purple);
    border-radius: 4px;
}

/* Adjust game cards inside the carousel */
.game-carousel .game-card {
    flex: 0 0 330px; /* Prevents cards from shrinking */
    width: 330px;
}


/* --- Styles for View Switcher & Controls --- */
.view-switcher {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    background-color: var(--content-bg);
    border-radius: 12px;
    padding: 5px;
    border: 1px solid var(--border-color);
    max-width: 280px; /* Adjusted for two buttons */
    margin-left: auto;
    margin-right: auto;
}

.view-switcher button {
    flex-grow: 1;
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 8px;
}

.view-switcher button.active {
    background-color: var(--accent-purple);
    color: white;
}

/* --- NEW: Styles for Browse Controls (Sort Dropdown) --- */
.browse-controls {
    margin-bottom: 40px;
    display: flex;
    justify-content: flex-end; /* Aligns dropdown to the right */
}

.sort-dropdown {
    background-color: var(--content-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9em;
    font-family: var(--font-body);
    cursor: pointer;
    -webkit-appearance: none; /* Removes default browser styling */
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px; /* Make space for the arrow */
}

.controls-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the search bar */
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--content-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.search-box {
    flex-grow: 1;
    min-width: 250px;
    max-width: 500px; /* Give the search box a max width */
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1em;
}

.top-list-section {
    margin-bottom: 50px;
}

.top-list-title {
    font-size: 2em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-purple);
}

/* =========================================================
   --- Products Page (products.html) Styles ---
   ========================================================= */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--content-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.product-image-container {
    background-color: #fff; /* White background for product images */
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--accent-purple);
    margin-top: auto; /* Pushes price and button to the bottom */
    padding-top: 15px;
    margin-bottom: 15px;
}

/* =========================================================
   --- Contact Page (contact.html) Styles ---
   ========================================================= */

.contact-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Form takes 2/3, info takes 1/3 */
    gap: 50px;
    align-items: start;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1em;
    font-family: var(--font-body);
}

.contact-info-list {
    list-style: none;
    padding: 0;
}

.contact-info-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.contact-info-list svg {
    width: 28px;
    height: 28px;
    fill: var(--accent-purple);
    flex-shrink: 0; /* Prevents icon from shrinking */
}

/* =========================================================
   --- Awards Page (awards.html) Styles ---
   ========================================================= */

.award-category {
    margin-bottom: 60px;
}

.award-category h2 {
    font-size: 2.2em;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-purple);
}

.award-layout {
    display: grid;
    grid-template-columns: 330px 1fr; /* UPDATED: Adjusted to fit standard game card width */
    gap: 40px;
    align-items: center;
}

/* REMOVED: .award-winner-card and related styles are no longer needed. */

.award-description p {
    font-size: 1.1em;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* =========================================================
   --- How It Works Page (how-it-works.html) Styles ---
   ========================================================= */

.content-section {
    margin-bottom: 50px;
}

.content-section ul {
    padding-left: 40px;
    margin-bottom: 15px;
}

.steps-container {
    display: grid;
    gap: 40px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

.step-icon {
    flex-shrink: 0;
}

.step-icon svg {
    width: 60px;
    height: 60px;
    fill: var(--accent-purple);
}

/* =========================================================
   --- Submit Execution Page (submit-execution.html) Styles ---
   ========================================================= */

.form-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
    background-color: var(--content-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

#geScoreForm {
    display: flex;
    flex-direction: column;
}

.score-input-group {
    order: -1; /* This moves the score to the top of the form */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.score-input-group label {
    text-align: center;
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-secondary);
}

#geScore {
    font-size: 3em;
    font-family: var(--font-heading);
    text-align: center;
    padding: 15px;
    margin-top: 10px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

/* =========================================================
   --- Responsive Design (Media Queries) ---
   ========================================================= */

@media (max-width: 768px) {
    /* Adjust header for smaller screens */
    .header-container {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .logo h1 {
        display: none; /* Hide full title on small screens to save space */
    }

    header nav ul {
        gap: 15px;
        padding-top: 10px;
    }
    
    /* Stack controls on the browse page vertically */
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    /* Stack contact form and info on small screens */
    .contact-layout {
        grid-template-columns: 1fr;
    }

    /* Stack award card and description on small screens */
    .award-layout {
        grid-template-columns: 1fr;
        justify-items: center; /* Center the card when stacked */
    }

    /* Stack step icon and content on small screens */
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Stack details grid on smaller screens */
    .details-grid {
        grid-template-columns: 1fr;
    }

    .details-left-col img {
        max-width: 300px; /* Constrain image width on mobile */
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}
/* =========================================================
   --- Submit Execution Page (Enhancements) ---
   ========================================================= */

/* Hero section for the main score input */
.score-input-group {
    order: -1; /* This moves the score to the top of the form */
    background-color: var(--background-color); /* Darker background for emphasis */
    padding: 30px 20px;
    margin: -40px -40px 30px -40px; /* Extend to the edges of the container */
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.score-input-group label {
    display: block; /* Ensure it's on its own line */
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 15px; /* More space below the label */
}

#geScore {
    font-size: 3.5em; /* Make the score number even larger */
    font-family: var(--font-heading);
    text-align: center;
    padding: 10px;
    margin-top: 0; /* Remove previous margin */
    width: 100%;
    max-width: 200px; /* Constrain the width of the input */
    margin-left: auto;
    margin-right: auto;
    background-color: var(--content-bg); /* Match other inputs */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Centered heading for the assessment questions */
#geScoreForm h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
}

/* Custom styled dropdowns (select elements) */
#geScoreForm select {
    background-color: var(--content-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1em;
    font-family: var(--font-body);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    width: 100%; /* Make dropdowns full width */
}

/* Consistent spacing for all form groups */
#geScoreForm .form-group {
    margin-bottom: 25px;
}

.rating-guide {
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color-translucent);
    margin-bottom: 20px;
    font-size: 0.9em;
    text-align: center;
}

.rating-scale {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.scale-item {
    flex: 1;
    text-align: center;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.scale-item strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.1em;
}

/* =========================================================
   --- Join Page (join.html) Styles ---
   ========================================================= */

.tiers-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tier-panel {
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.tier-panel.pro {
    position: relative;
    border-color: var(--accent-purple);
}

.tier-panel .popular-badge {
    background-color: var(--accent-purple);
    color: white;
    font-size: 0.8em;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    position: absolute;
    top: -15px;
    right: 20px;
}

.tier-info {
    flex: 1 1 40%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.tier-features {
    flex: 1 1 55%;
    min-width: 300px;
}

.tier-name {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.tier-price {
    font-size: 2.5em;
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.tier-price span {
    font-size: 0.5em;
    color: var(--text-secondary);
}

.tier-description {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.tier-action {
    margin-top: auto; /* Pushes button to the bottom */
}

.tier-action .cta-button {
    width: 100%;
    max-width: 250px;
}

.tier-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tier-features li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 12px;
}

.tier-features li svg {
    width: 24px;
    height: 24px;
    fill: var(--tgm-green);
    flex-shrink: 0;
    margin-top: 2px;
}

/* =========================================================
   --- For Developers Page (for-developers.html) Styles ---
   ========================================================= */

.form-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
    background-color: var(--content-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1em;
    font-family: var(--font-body);
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-container .cta-button {
    width: 100%;
    margin-top: 10px;
}

/* --- NEW STYLES FOR HEADER BADGES --- */

/* Container for the user identity (Name + Badges) */
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px; /* Space between name and badge group */
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-menu-trigger:hover {
    background-color: var(--border-color);
}

.welcome-msg {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
}

/* Container for all badges to keep them grouped */
.badge-group {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between individual badges */
}

/* Style for the SVG Role/Cert Badges */
.header-role-badge {
    height: 24px; /* Fixed height for header consistency */
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); /* Subtle shadow for depth */
    transition: transform 0.2s ease;
}

.header-role-badge:hover {
    transform: scale(1.1);
}
