/* mgm_royal_theme/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --red: #c0392b;
    --red-dark: #922b21;
    --red-deep: #641e16;
    --gold: #f1c40f;
    --gold-light: #f9e547;
    --gold-dark: #d4ac0d;
    --bg-main: #110808;
    --bg-surface: #2a1515;
    --bg-surface-light: #3a2020;
    --text-main: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(241, 196, 15, 0.15);
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #000;
    color: var(--text-main);
    overflow-x: hidden;
}

a { text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; outline: none; border: none; font-family: 'Inter', sans-serif;}

/* --- Layout Architecture --- */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-main);
    position: relative;
    box-shadow: 0 0 50px rgba(192, 57, 43, 0.1);
}

/* Sidebar (Hidden on Mobile) */
.desktop-sidebar {
    display: none;
    width: var(--sidebar-width);
    background: linear-gradient(to bottom, var(--bg-surface), var(--bg-main));
    border-right: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
}

.sidebar-logo {
    padding: 24px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-nav {
    padding: 20px 10px;
    flex: 1;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.sidebar-nav-item:hover, .sidebar-nav-item.active {
    background: rgba(241, 196, 15, 0.1);
    color: var(--gold);
}

.sidebar-nav-item i {
    font-size: 20px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    position: relative;
    padding-bottom: calc(80px + var(--safe-bottom)); /* Space for mobile nav */
    min-width: 0;
}

/* Mobile Header */
.mobile-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--red-dark), var(--red));
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(192, 57, 43, 0.4);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.balance-pill {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(241, 196, 15, 0.4);
    border-radius: 50px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-weight: 700;
    font-size: 14px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
}

.header-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    width: 180px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 200;
}
.header-dropdown.show { display: flex; }
.header-dropdown a {
    padding: 12px 16px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}
.header-dropdown a:hover { background: rgba(255,255,255,0.05); color: var(--gold); }
.header-dropdown a:last-child { border-bottom: none; }

/* Bottom Navigation (Hidden on Desktop) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background: rgba(26, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    height: 65px;
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--border-glass);
    z-index: 1000;
}

.nav-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-dim);
    width: 20%;
    height: 100%;
    font-size: 11px;
    font-weight: 600;
    transition: 0.2s;
}

.nav-tab.active { color: var(--gold); }
.nav-tab i { position: absolute; top: 12px; font-size: 20px; }
.nav-tab span { position: absolute; bottom: 10px; text-align: center; width: 100%; }

.nav-tab.fab .fab-circle {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid var(--bg-main);
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
    color: #000;
}
.nav-tab.fab .fab-circle i {
    position: relative;
    top: 0;
    font-size: 24px;
}
.nav-tab.fab span { color: var(--gold); }

/* SVG Logo Style */
.mgm-logo-svg {
    height: 36px;
    width: auto;
}

/* --- Homepage Carousel --- */
.carousel-container {
    margin: 16px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    height: 180px;
}
.carousel-track {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}
.slide {
    width: 33.333%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, var(--red-dark), var(--red));
    display: flex; align-items: center; padding: 24px;
}
.carousel-dots {
    position: absolute; bottom: 12px; width: 100%;
    display: flex; justify-content: center; gap: 6px; z-index: 10;
}
.dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.4); transition: 0.3s;
}
.dot.active { background: var(--gold); width: 16px; border-radius: 4px; }

/* --- Quick Grid specific colors from Design 6 --- */
.qg-icon {
    width: 56px; height: 56px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white; transition: 0.2s;
}
.qg-item:active .qg-icon { transform: scale(0.9); }
.qg1 { background: #d32f2f; box-shadow: 0 0 15px rgba(211,47,47,0.5); }
.qg2 { background: #f57f17; box-shadow: 0 0 15px rgba(245,127,23,0.5); }
.qg3 { background: #388e3c; box-shadow: 0 0 15px rgba(56,142,60,0.5); }
.qg4 { background: #1976d2; box-shadow: 0 0 15px rgba(25,118,210,0.5); }
.qg-label { font-size: 12px; font-weight: 600; color: var(--text-main); margin-top: 6px; }

/* --- Total Balance Card --- */
.balance-master-card {
    background: #1e1111;
    border: 1px solid rgba(241,196,15,0.2);
    border-radius: 16px;
    padding: 20px;
    margin: 10px 16px 24px;
}
.bmc-top {
    display: flex; justify-content: space-between; align-items: center;
}
.bmc-lbl { font-size: 10px; color: var(--text-dim); text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 2px; }
.bmc-amt { font-size: 32px; font-weight: 900; color: var(--gold); }
.bmc-btn {
    background: var(--gold); color: #000;
    padding: 10px 16px; border-radius: 8px; font-weight: 800; font-size: 13px;
}
.bmc-divider {
    height: 1px; background: rgba(255,255,255,0.05);
    margin: 20px 0;
}
.bmc-bottom {
    display: flex; justify-content: space-between;
}
.bmc-stat { text-align: center; }
.bmc-s-val { font-size: 15px; font-weight: 800; color: white; margin-bottom: 2px; }
.bmc-s-lbl { font-size: 9px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; }

/* --- Shared Components --- */
.section-title {
    padding: 0 16px;
    margin: 20px 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: var(--gold);
    border-radius: 4px;
}
.section-title a {
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    margin: 0 16px 16px;
    padding: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #000;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.5);
}

/* --- Responsive Breakpoints --- */

/* Desktop / Tablet Landscape */
@media (min-width: 769px) {
    .desktop-sidebar {
        display: flex;
    }
    
    .mobile-bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 20px;
    }

    /* Adjust header for desktop */
    .mobile-header {
        background: transparent;
        box-shadow: none;
        border-bottom: 1px solid var(--border-glass);
        padding: 20px 30px;
        justify-content: flex-end;
    }
    .mobile-header .header-logo {
        display: none; /* Logo is in the sidebar on desktop */
    }
    
    /* Make grids wider */
    .games-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        padding: 0 30px !important;
    }
    .quick-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        padding: 20px 30px !important;
    }
    
    .section-title {
        padding: 0 30px;
    }
    .card {
        margin: 0 30px 24px;
    }
}
