/* Modern Glassmorphic Dark Design System for Teacher Neutron's Board Game Portal */

:root {
    /* Color Palette */
    --color-bg-base: #070913;
    --color-bg-surface: rgba(15, 23, 42, 0.45);
    --color-bg-card: rgba(30, 41, 59, 0.35);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-glow: rgba(99, 102, 241, 0.25);
    
    --color-primary: #6366f1;       /* Indigo Glow */
    --color-primary-rgb: 99, 102, 241;
    --color-secondary: #06b6d4;     /* Cyan Glow */
    --color-secondary-rgb: 6, 182, 212;
    --color-accent: #f43f5e;        /* Rose Glow */
    --color-accent-rgb: 244, 63, 94;
    
    --color-emerald: #10b981;
    --color-amber: #f59e0b;
    --color-slate-100: #f1f5f9;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-800: #1e293b;
    
    /* Typography */
    --font-heading: 'Outfit', 'Sarabun', sans-serif;
    --font-body: 'Inter', 'Sarabun', sans-serif;
    
    /* Effects & Shadows */
    --glass-blur: blur(20px);
    --glow-shadow-primary: 0 0 20px rgba(99, 102, 241, 0.35);
    --glow-shadow-secondary: 0 0 20px rgba(6, 182, 212, 0.35);
    --glow-shadow-accent: 0 0 20px rgba(244, 63, 94, 0.35);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--color-bg-base);
    color: var(--color-slate-100);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Animated Glow Blobs */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.45;
    pointer-events: none;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(0,0,0,0) 70%);
    top: -200px;
    left: -100px;
    animation: float-glow 25s infinite alternate ease-in-out;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(0,0,0,0) 70%);
    bottom: -100px;
    right: -100px;
    animation: float-glow 20s infinite alternate-reverse ease-in-out 2s;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.15) 0%, rgba(0,0,0,0) 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float-glow 30s infinite alternate ease-in-out 4s;
}

@keyframes float-glow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.1); }
    100% { transform: translate(-30px, 30px) scale(0.9); }
}

/* App Layout */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main Header */
.main-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    background: var(--color-bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo svg {
    filter: drop-shadow(0 0 8px var(--color-primary));
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.logo-text span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-secondary);
    letter-spacing: 3px;
    display: block;
}

.header-tagline h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-slate-100);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header-tagline p {
    font-size: 0.9rem;
    color: var(--color-slate-400);
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--color-bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    border-color: var(--color-border-glow);
    transform: translateY(-2px);
}

.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-slate-400);
    font-weight: 500;
}

/* Games Grid Section */
.games-section {
    flex-grow: 1;
    margin-bottom: 3rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    padding-left: 0.75rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--color-primary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--color-primary);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Game Card (Link element wrapper) */
.game-card {
    background: var(--color-bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.game-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(0, 0, 0, 0) 60%);
    z-index: 0;
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.game-card:hover .game-card-bg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.05) 100%);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.15);
}

.game-badge {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.difficulty-easy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.difficulty-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.game-icon {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    display: inline-block;
}

.game-icon svg {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-card:hover .game-icon svg {
    transform: scale(1.1) rotate(5deg);
}

.game-card h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-slate-100);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.game-card p {
    font-size: 0.85rem;
    color: var(--color-slate-400);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.game-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.meta-item {
    font-size: 0.75rem;
    color: var(--color-slate-400);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.03);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.03);
}

.meta-item svg {
    opacity: 0.7;
}

.play-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-slate-100);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 1;
    text-align: center;
}

.game-card:hover .play-btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-color: transparent;
    box-shadow: var(--glow-shadow-primary);
    transform: scale(1.02);
}

/* Main Footer */
.main-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.main-footer p {
    font-size: 0.85rem;
    color: var(--color-slate-400);
    margin-bottom: 0.5rem;
}

.main-footer .copyright {
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
}

/* Responsive queries */
@media (max-width: 768px) {
    .main-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
        text-align: center;
    }
    
    .header-logo {
        justify-content: center;
    }
    
    .stats-bar {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}
