/**
 * BoardGamify - Main Styles
 * 
 * All colors use CSS variables from colors.css
 * This allows easy theme switching and customization
 * 
 * LOAD ORDER:
 * 1. colors.css (variables)
 * 2. styles.css (this file)
 * 3. styles-mobile.css (mobile overrides)
 */

/* ============================================
   RESET
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg-page);
    color: var(--color-text-primary);
    line-height: 1.5;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;   /* disable the native page scrollbar */
}

#page-scroll {
    height: 100%;
    overflow-y: auto;   /* this is now the thing that scrolls */
}

/* Page wrapper */
.bg-page {
    min-height: 100vh;
    background: var(--gradient-page);
    color: var(--color-text-primary);
}

/* ============================================
   HEADER
   ============================================ */

.bg-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bg-logo span {
    font-weight: 700;
    font-size: 1.25rem;
    margin-left: 6px;
    color: var(--color-text-primary);
}

/* ============================================
   NAVIGATION
   ============================================ */

.bg-nav {
    display: flex;
    gap: 24px;
}

.bg-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.bg-nav a:hover {
    color: var(--color-link-hover);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.bg-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   HERO SECTION
   ============================================ */

.bg-hero {
    background: var(--gradient-hero);
    border-radius: 24px;
    padding: 32px 28px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 32px;
}

.bg-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.bg-hero p {
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.bg-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.bg-search-bar input {
    flex: 1;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--color-border-input);
    font-size: 0.95rem;
    background: var(--color-bg-input);
    color: var(--color-text-primary);
}

.bg-search-bar input::placeholder {
    color: var(--color-text-muted);
}

.bg-search-bar input:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: var(--shadow-focus-ring);
}

.bg-search-bar button {
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    background: var(--color-button-primary);
    color: var(--color-button-text);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.05s ease;
}

.bg-search-bar button:hover {
    background: var(--color-button-primary-hover);
}

.bg-search-bar button:active {
    transform: translateY(1px);
}

/* ============================================
   HERO TAGS
   ============================================ */

.bg-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bg-hero-tags span {
    display: inline-block;
    background: var(--color-bg-tag);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--color-text-primary);
    font-weight: 500;
}

/* ============================================
   SECTIONS
   ============================================ */

.bg-section {
    margin-bottom: 32px;
}

.bg-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    color: var(--color-text-primary);
}

.bg-section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.bg-section-header a {
    color: var(--color-link);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.bg-section-header a:hover {
    color: var(--color-link-hover);
}

/* ============================================
   GAME CARDS
   ============================================ */

.bg-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.bg-game-card {
    background: var(--color-bg-surface);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border-subtle);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.bg-cover-placeholder {
    background: var(--gradient-placeholder);
    border-radius: 14px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.bg-game-card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    color: var(--color-text-primary);
    font-weight: 600;
}

.bg-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.bg-tags {
    font-size: 0.8rem;
    color: var(--color-text-tertiary);
}

/* ============================================
   FOOTER
   ============================================ */

.bg-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px 32px;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.bg-footer a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.bg-footer a:hover {
    color: var(--color-link-hover);
}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */


@media (max-width: 900px) and (min-width: 769px) {
    .bg-header {
        padding: 6px 16px;
    }

    /* Slightly smaller logo so the nav has more room */
    .bg-logo img {
        height: 52px !important;
    }

    /* Tighten spacing between menu items */
    .bg-nav {
        gap: 16px;
    }

    /* Scale down main nav font size */
    .bg-nav a,
    .bg-nav .dropdown-toggle {
        font-size: 0.85rem;
    }

    /* Admin pill spacing/font */
    .admin-dropdown {
        padding-left: 16px;
    }

    .admin-dropdown .dropdown-toggle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Admin dropdown items a bit smaller too */
    .admin-dropdown .dropdown-menu a {
        font-size: 0.85rem;
        padding: 8px 14px;
    }
}


@media (max-width: 769px) {
    .bg-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .bg-nav {
        width: 100%;
        justify-content: center;
    }
    
    .bg-hero h1 {
        font-size: 1.8rem;
    }
    
    .bg-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* ============================================
   DROPDOWN MENUS
   ============================================ */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.dropdown-toggle:hover {
    color: var(--color-link-hover);
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-dropdown);
    min-width: 180px;
    margin-top: 8px;
    z-index: 1000;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--color-border-subtle);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--color-bg-hover);
    color: var(--color-link-hover);
}

/* Admin dropdown - special styling */
.admin-dropdown {
    margin-left: auto;
    border-left: 2px solid var(--color-border-subtle);
    padding-left: 24px;
}

.admin-dropdown .dropdown-toggle {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
}

.admin-dropdown .dropdown-toggle:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.admin-dropdown .dropdown-toggle::after {
    color: white;
}

.admin-dropdown .dropdown-menu {
    border: 2px solid #ef4444;
}