/* Global CSS - Design System and Base Styles */

/* ========== Font Imports ========== */
@font-face {
    font-family: 'Righteous';
    src: url('../fonts/Righteous-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ========== CSS Variables / Design Tokens ========== */
:root {
    /* Color Palette */
    --primary: #0066FF;
    /* Blue */
    --secondary: #0052CC;
    /* Darker blue */
    --accent: #FFCC33;
    /* Yellow/Gold */
    --background: #FFFFFF;
    /* White */
    --surface: #F8F9FA;
    /* Light gray */
    --surface-light: #E9ECEF;
    /* Lighter gray */
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-muted: #ADB5BD;
    --border: #DEE2E6;
    --success: #28A745;
    --warning: #FFC107;
    --error: #DC3545;

    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-game: 'Press Start 2P', monospace;
    --font-logo: 'Righteous', cursive;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Breakpoints (for reference in JS) */
    --mobile: 640px;
    --tablet: 768px;
    --desktop: 1024px;
    --wide: 1280px;
}

/* ========== Reset & Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== Typography ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary);
}

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========== Header & Navigation ========== */
.site-header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: var(--spacing-sm) var(--spacing-md);
    /* Reduced top/bottom to sm, kept horizontal padding */
}

.nav-container {
    max-width: none;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    /* Added side padding to push logo and nav inward slightly */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    order: 1;
    margin-right: auto;
    /* Pushes other absolute/flex items to the right */
}

.nav-brand .logo {
    display: flex;
    align-items: center;
    font-family: var(--font-logo) !important;
    font-size: 2.2rem !important;
    font-weight: bold;
    text-decoration: none;
    transition: all var(--transition-fast);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-brand .logo:hover {
    transform: scale(1.05);
}

.logo-part-the {
    color: #004099 !important;
    font-family: var(--font-logo) !important;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.logo-part-gamecove {
    color: #0066FF !important;
    font-family: var(--font-logo) !important;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-brand .logo:hover .logo-part-gamecove {
    color: #0066FF !important;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    z-index: 1000;
    order: 3;
    margin-left: var(--spacing-md);
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition-fast);
}

.nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 300px;
    max-width: 80vw;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    padding: 100px var(--spacing-md) var(--spacing-md);
    transform: translateX(100%);
    /* Start hidden completely to the right */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    /* Just below the nav-toggle's 1000 */
    overflow-y: auto;
}

.nav-menu.active {
    transform: translateX(0);
    /* Slide into view */
}

.nav-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0;
}

/* ========== Header Search ========== */
.header-search-container {
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 400px;
    width: 100%;
    order: 2;
}

.header-search-container .search-input {
    width: 100%;
    padding: 10px 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    font-size: var(--text-base);
    background-color: var(--surface);
    transition: all var(--transition-base);
}

.header-search-container .search-input:focus {
    background-color: var(--background);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.15);
    outline: none;
}

.header-search-container .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
    pointer-events: none;
}

.header-search-container .search-btn {
    display: none;
    /* Hide the old button if it still exists */
}

.header-search-container .clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    line-height: 1;
    /* Stops font metrics from pushing it off-center */
    padding: 0;
    /* Clear default button padding */
    transition: all var(--transition-fast);
}

.header-search-container .clear-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 0;
    display: block;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary);
    background-color: var(--surface-light);
    padding-left: calc(var(--spacing-xl) + 5px);
}

.nav-link.active {
    color: var(--primary);
    background-color: rgba(0, 102, 255, 0.1);
    border-left: 3px solid var(--primary);
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--text-base);
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--surface-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--surface);
    transform: translateY(-2px);
}

/* ========== Cards ========== */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

/* ========== Forms ========== */
input,
textarea,
select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-base);
    font-family: var(--font-body);
    background-color: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

/* ========== Badges ========== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: var(--text-xs);
    font-weight: 600;
    background-color: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    margin-left: var(--spacing-xs);
}

/* ========== Loading States ========== */
.loading-message {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--text-secondary);
    font-size: var(--text-lg);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Footer ========== */
.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding: var(--spacing-md) 0 var(--spacing-sm);
}

.footer-container {
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: var(--spacing-sm);
}

.footer-section h3 {
    font-size: var(--text-base);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-xs);
    font-size: var(--text-sm);
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* ========== Utilities ========== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .nav-brand {
        flex: 1;
    }

    .nav-toggle {
        order: 2;
        margin-left: 0;
    }

    .header-search-container {
        position: relative;
        left: 0;
        transform: none;
        order: 3;
        max-width: 100%;
        margin-right: 0;
        margin-top: var(--spacing-sm);
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}