/* Global Reset & Typography */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---------------------------------
   THEME DEFINITIONS (CSS Variables)
   --------------------------------- */
/* 1. Normal (Light) Theme */
:root {
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --hero-desc-color: #c8d4c4;
    --header-bg: #ffffff;
    --header-shadow: rgba(0, 0, 0, 0.1);
    --logo-color: #0056b3;
    --nav-link-color: #555555;
    --nav-link-active: #0056b3;
    --hero-gradient: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    --hero-text: #ffffff;
    --footer-bg: #212529;
    --footer-text: #dee2e6;
    --dropdown-bg: #ffffff;
    --dropdown-text: #333333;
    --dropdown-border: #cccccc;
    
    /* Card Elements Base */
    --card-bg: #ffffff;
    --card-border-top: #0056b3;
    --card-title-color: #222222;
    --card-desc-color: #666666;
    --card-label-color: #0056b3;
    --card-value-color: #495057;
    --card-divider: #dee2e6;
    --status-text-color: #888888;
}

/* 2. Dark Theme */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --hero-desc-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --header-shadow: rgba(0, 0, 0, 0.5);
    --logo-color: #3792cb;
    --nav-link-color: #aaaaaa;
    --nav-link-active: #3792cb;
    --hero-gradient: linear-gradient(135deg, #1f1f1f 0%, #0d0d0d 100%);
    --hero-text: #e0e0e0;
    --footer-bg: #1a1a1a;
    --footer-text: #888888;
    --dropdown-bg: #2d2d2d;
    --dropdown-text: #e0e0e0;
    --dropdown-border: #444444;
    
    /* Card Elements Dark */
    --card-bg: #1e1e1e;
    --card-border-top: #3792cb;
    --card-title-color: #ffffff;
    --card-desc-color: #aaaaaa;
    --card-label-color: #3792cb;
    --card-value-color: #bbbbbb;
    --card-divider: #333333;
    --status-text-color: #666666;
}

/* 3. The Weeknd Theme */
[data-theme="weeknd"] {
    --bg-color: #050000;
    --text-color: #ffffff;
    --hero-desc-color: #ffffff;
    --header-bg: #0d0101;
    --header-shadow: rgba(255, 0, 0, 0.2);
    --logo-color: #e50914;
    --nav-link-color: #b3b3b3;
    --nav-link-active: #ff0000;
    --hero-gradient: linear-gradient(180deg, #1a0202 0%, #000000 100%);
    --hero-text: #ff3333;
    --footer-bg: #0d0101;
    --footer-text: #666666;
    --dropdown-bg: #1a0202;
    --dropdown-text: #ff3333;
    --dropdown-border: #e50914;
    
    /* Card Elements The Weeknd */
    --card-bg: #0d0101;
    --card-border-top: #ff0000;
    --card-title-color: #ff3333;
    --card-desc-color: #ffffff;
    --card-label-color: #ff3333;
    --card-value-color: #ffffff;
    --card-divider: #260505;
    --status-text-color: #e50914;
}

/* ---------------------------------
   GLOBAL LAYOUT COMPONENTS
   --------------------------------- */
body { 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

header { 
    background-color: var(--header-bg); 
    box-shadow: 0 2px 5px var(--header-shadow); 
    position: sticky; 
    top: 0; 
    z-index: 1000;
}

.nav-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
}

.logo { 
    font-size: 24px; 
    font-weight: bold; 
    color: var(--logo-color); 
    text-decoration: none; 
}

[data-theme="weeknd"] .logo {
    text-shadow: 0 0 8px #ff0000;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links { 
    list-style: none; 
    display: flex; 
    gap: 20px; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--nav-link-color); 
    font-weight: 500; 
    padding: 8px 12px; 
}

.nav-links a.active, .nav-links a:hover { 
    color: var(--nav-link-active); 
}

.theme-selector-wrapper {
    display: flex;
    align-items: center;
}

.theme-dropdown {
    background-color: var(--dropdown-bg);
    color: var(--dropdown-text);
    border: 1px solid var(--dropdown-border);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

[data-theme="weeknd"] .theme-dropdown {
    box-shadow: 0 0 5px #ff0000;
}

footer { 
    background-color: var(--footer-bg); 
    color: var(--footer-text); 
    padding: 30px 20px; 
    text-align: center; 
}

/* ---------------------------------
   INDEX PAGE EXCLUSIVE STYLES
   --------------------------------- */
.hero { 
    background: var(--hero-gradient); 
    padding: 140px 20px; 
    text-align: center; 
    flex-grow: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.hero-content h1 { 
    font-size: 48px; 
    margin-bottom: 20px; 
    color: var(--hero-text);
}

[data-theme="weeknd"] .hero-content h1 {
    text-shadow: 0 0 15px #ff0000;
    color: #ffffff;
}

.hero-content p { 
    font-size: 24px; 
    font-weight: 300; 
    opacity: 0.95; 
    color: var(--hero-desc-color); 
}

/* ---------------------------------
   ABOUT PAGE EXCLUSIVE STYLES
   --------------------------------- */
.main-container { 
    max-width: 800px; 
    width: 100%; 
    margin: 40px auto; 
    padding: 0 20px; 
    flex-grow: 1; 
}

.info-card { 
    background-color: var(--card-bg); 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border-top: 5px solid var(--card-border-top); 
}

[data-theme="weeknd"] .info-card {
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
}

.info-card h1 { 
    font-size: 32px; 
    margin-bottom: 25px; 
    color: var(--text-color);
}

[data-theme="weeknd"] .info-card h1 {
    text-shadow: 0 0 10px #ff0000;
}

.detail-row { 
    display: flex; 
    padding: 15px 0; 
    border-bottom: 1px solid var(--card-divider); 
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label { 
    font-weight: bold; 
    color: var(--card-label-color); 
    width: 160px; 
    flex-shrink: 0;
}

.detail-value { 
    color: var(--card-value-color); 
    font-size: 18px; 
    word-wrap: break-word;
}

/* ---------------------------------
   GAMES PAGE EXCLUSIVE STYLES
   --------------------------------- */
.games-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 25px; 
    margin-bottom: 40px; 
}

.game-card { 
    background-color: var(--card-bg); 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    text-align: center; 
    border-top: 4px solid var(--card-border-top); 
}

[data-theme="weeknd"] .game-card {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
}

.game-icon { 
    font-size: 48px; 
    margin-bottom: 15px; 
}

.game-card h2 { 
    font-size: 22px; 
    margin-bottom: 10px; 
    color: var(--card-title-color);
}

.game-card p {
    color: var(--card-desc-color);
    font-size: 15px;
}

.status-msg { 
    text-align: center; 
    font-style: italic; 
    color: var(--status-text-color); 
    font-size: 18px; 
    margin-top: 20px;
}

[data-theme="weeknd"] .status-msg {
    text-shadow: 0 0 5px #ff0000;
}

/* ---------------------------------
   GLOBAL RESPONSIVE BREAKPOINTS
   --------------------------------- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .nav-controls {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    .nav-links {
        justify-content: center;
        gap: 10px;
    }
    .hero {
        padding: 80px 20px;
    }
    .hero h1 {
        font-size: 32px;
    }
    .main-container {
        margin: 20px auto;
    }
    .info-card, .game-card {
        padding: 25px;
    }
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    .detail-value {
        font-size: 16px;
    }
}
/* ---------------------------------
   PAGE FADE-IN ANIMATION
   --------------------------------- */
body {
    opacity: 0;
    animation: fadeInPage 0.5s ease-in forwards;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(5px); /* Gentle slide-up effect */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------------------
   DYNAMIC GREETING STYLING
   --------------------------------- */
.greeting-text {
    font-weight: bold;
    color: var(--logo-color);
}
[data-theme="weeknd"] .greeting-text {
    text-shadow: 0 0 8px #ff0000;
    color: #ff3333;
}
/* ---------------------------------
   GLOBAL SCROLLBAR FIX (DEBUG)
   --------------------------------- */
html {
    /* Reserves space for the scrollbar track so layout text never shifts sideways */
    scrollbar-gutter: stable;
}

body {
    opacity: 0;
    animation: fadeInPage 0.5s ease-in forwards;
    /* Prevents brief horizontal tracks during slide animation */
    overflow-x: hidden; 
}

@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------------------------------
   GAME CARDS HOVER GLOW EFFECTS
   --------------------------------- */
.game-card { 
    background-color: var(--card-bg); 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    text-align: center; 
    border-top: 4px solid var(--card-border-top);
    /* Essential for smooth animation when moving mouse over and out */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; 
}

/* Light Mode Hover Glow */
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 86, 179, 0.2);
}

/* Dark Mode Hover Glow Override */
[data-theme="dark"] .game-card:hover {
    box-shadow: 0 10px 25px rgba(55, 146, 203, 0.4);
}

/* The Weeknd Theme Hover Glow Override & Base Setup */
.game-card {
    /* Keep your existing style fallback rule */
}
[data-theme="weeknd"] .game-card {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
}
[data-theme="weeknd"] .game-card:hover {
    transform: translateY(-5px);
    border-color: #ff3333;
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
}
