/* ============================================
   BEULROCK SS - PROFESSIONAL RED/DARK THEME
   Modern, Fully Responsive, Glassmorphism, High-End
   ============================================ */

/* ---------- CSS VARIABLES (RED THEME) ---------- */
:root {
    /* Warna Tema (Red/Black/Dark) */
    --bg-body: #050000;           /* Hitam Pekat */
    --bg-glass: rgba(10, 5, 5, 0.65); /* Kaca Merah Gelap */
    --bg-glass-hover: rgba(220, 38, 38, 0.1); 
    --bg-input: rgba(0, 0, 0, 0.4);
    
    /* Warna Teks */
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --text-inverse: #000000;
    
    /* Warna Aksen (Red Blood) */
    --primary: #dc2626;           /* Merah Utama */
    --primary-dark: #7f1d1d;      /* Merah Gelap */
    --accent: #f87171;            /* Merah Terang */
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #dc2626, #7f1d1d);
    --gradient-glow: linear-gradient(135deg, #ef4444, #991b1b);
    --gradient-text: linear-gradient(135deg, #ffffff, #fca5a5);
    --gradient-bg: radial-gradient(circle at top right, rgba(220, 38, 38, 0.15), transparent 50%);

    /* Borders & Effects */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(220, 38, 38, 0.4);
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.3);
    
    /* Spacing System */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2.5rem;
    --spacing-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 3rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    
    /* Navbar Height */
    --navbar-height: 80px;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    font-size: 16px; /* Base size */
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Setup Background Image (Skull) dengan Overlay agar teks terbaca */
    background-image: var(--gradient-bg); 
    background-blend-mode: overlay;
}

/* Jika ada class .bg-image di body, gunakan gambar */
body.bg-image-enabled {
    background-image: url('f5c57c5f-0209-4292-b7e8-f30aa3d705ab.jpg'), var(--gradient-bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-blend-mode: hard-light; /* Blend gambar dengan warna merah */
}

/* Overlay Global untuk memastikan kontras */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Darken whole site */
    z-index: -1;
    pointer-events: none;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); text-transform: uppercase; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.1rem; font-weight: 600; }

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

/* ---------- LAYOUT UTILITIES ---------- */
.container {
    max-width: 1400px; /* Lebih lebar untuk dashboard */
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    width: 100%;
}

.section {
    padding: var(--spacing-xl) 0;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---------- COMPONENTS: GLASS CARD ---------- */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

.card {
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-glow);
    transform: translateY(-4px);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.15);
}

/* ---------- NAVBAR ---------- */
.navbar {
    height: var(--navbar-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(5, 0, 0, 0.85);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    color: white;
}

/* Logo Image Support */
.logo img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--primary));
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
}

/* Active Underline Effect */
.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -29px; /* Adjust based on navbar height */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(220, 38, 38, 0.1);
    color: white;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* ---------- INPUTS & FORMS ---------- */
input, textarea, select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

::placeholder { color: rgba(255, 255, 255, 0.2); }

/* ---------- GRIDS & STATS ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-glass);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    text-align: center;
    transition: var(--transition-normal);
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: var(--spacing-sm) 0;
    text-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
}

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ---------- GAME CARDS ---------- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.game-card {
    background: #0a0505;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #330000;
    transition: var(--transition-normal);
    position: relative;
}

.game-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-6px);
}

.game-banner {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.game-info { padding: var(--spacing-md); }

/* ---------- AUTH (LOGIN/REGISTER) ---------- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.auth-box {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

/* ---------- SIDEBAR (DASHBOARD) ---------- */
.sidebar {
    width: 280px;
    background: var(--bg-glass);
    border-right: 1px solid var(--border-light);
    height: calc(100vh - var(--navbar-height));
    position: sticky;
    top: var(--navbar-height);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    margin-bottom: 4px;
    cursor: pointer;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: white; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.2), transparent);
    color: var(--accent);
    border-left: 3px solid var(--primary);
}

/* ---------- UTILITIES ---------- */
.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-center { text-align: center; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-md); }

/* ---------- SCROLLBAR (RED THEME) ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0f0f0f; }
::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary); 
}

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.6s ease-out forwards; }

/* ============================================
   RESPONSIVE MEDIA QUERIES (ALL DEVICES)
   ============================================ */

/* Mobile Devices (Small Phones) */
@media (max-width: 640px) {
    :root { --navbar-height: 60px; }
    
    .navbar {
        flex-wrap: wrap;
        padding: 1rem;
        height: auto;
    }
    
    .logo { font-size: 1.2rem; }
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 1rem;
        margin-top: 10px;
        order: 3;
        flex-wrap: wrap;
    }
    
    .nav-links a { font-size: 0.8rem; }
    .btn-outline { padding: 0.5rem 1rem; }
    
    /* Mobile Grids: 1 Column */
    .stats-grid, .games-grid { grid-template-columns: 1fr; }
    
    .sidebar {
        display: none; /* Hide sidebar on small mobile, usually replaced by bottom nav or drawer */
    }
    
    .container { padding: 0 var(--spacing-md); }
    h1 { font-size: 2rem; }
}

/* Tablet Devices (Medium) */
@media (min-width: 641px) and (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .games-grid { grid-template-columns: repeat(2, 1fr); }
    
    .sidebar {
        width: 80px; /* Compact sidebar */
        padding: 1rem 0.5rem;
        align-items: center;
    }
    
    .nav-item span { display: none; } /* Hide text on compact sidebar */
    .nav-item i { font-size: 1.5rem; margin: 0; }
    .nav-group-title { display: none; }
}

/* Desktop Devices (Large) */
@media (min-width: 1025px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .games-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}