:root {
    --bg-dark: #000000;
    --bg-card: #111111;
    --bg-sidebar: #050505;
    --text-main: #ffffff;
    --text-muted: #888888;

    /* Black & White Theme - Braun Style */
    --accent: #FFFFFF;
    --accent-secondary: #E5E5E5;
    --accent-glow: rgba(255, 255, 255, 0.2);

    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;

    --border-color: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar-nav {
    width: 250px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
}

.sidebar-menu {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    gap: 1rem;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    border-right: 3px solid var(--accent);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem 3rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Mobile Header Adjustment */
@media (max-width: 768px) {
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
        margin: 0;
    }
}

.page-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    color: var(--accent);
}

.user-profile-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.user-profile-preview img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--accent);
}

.user-profile-preview span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.stat-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.dashboard-main,
.dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Slot Machine - Minimalist Black & White */
.slot-machine-container {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 3px solid var(--border-strong);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.slot-window {
    background: #000;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    height: 150px;
    margin: 2rem auto;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 400px;
}

.slot-reels {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.reel {
    width: 80px;
    height: 100px;
    background: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #333;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.reel.spinning::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.8) 100%);
    animation: spinBlur 0.1s linear infinite;
}

@keyframes spinBlur {
    0% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(10px);
    }
}

.slot-controls {
    margin-top: 2rem;
}

.btn-spin {
    background: var(--accent);
    border: none;
    padding: 1rem 4rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 0 #333, 0 8px 16px rgba(0, 0, 0, 0.5);
    transition: all 0.1s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-spin:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #333, 0 4px 8px rgba(0, 0, 0, 0.5);
}

.btn-spin:disabled {
    filter: grayscale(1);
    cursor: not-allowed;
    opacity: 0.5;
}

.slot-message {
    margin-top: 1rem;
    height: 2rem;
    color: var(--accent);
    font-weight: 600;
}

/* History List (Compact) */
.history-list-compact .history-item {
    font-size: 0.9rem;
    padding: 0.8rem;
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--accent);
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive (Mobile) */
/* Mobile Nav Hidden by Default */
.mobile-top-nav {
    display: none;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Sticky Top Navigation Bar */
    /* Sticky Top Navigation Bar Wrapper */
    .app-container {
        flex-direction: column;
        padding-top: 60px;
        /* Space for fixed header */
    }

    /* New Mobile Top Nav (Matches Shop.html) */
    .mobile-top-nav {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-color);
        z-index: 1000;
        align-items: center;
        justify-content: space-between;
        padding: 0 1rem;
        backdrop-filter: blur(10px);
    }

    .mobile-logo {
        font-family: 'Outfit', sans-serif;
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--accent);
        text-decoration: none;
    }

    .mobile-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .mobile-icon-btn {
        background: transparent;
        border: none;
        color: var(--text-main);
        font-size: 1.2rem;
        cursor: pointer;
        position: relative;
    }

    .mobile-icon-btn .badge {
        position: absolute;
        top: -5px;
        right: -8px;
        background: #fff;
        color: #000;
        font-size: 0.6rem;
        font-weight: bold;
        padding: 2px 4px;
        border-radius: 50%;
    }

    /* Off-Canvas Sidebar Drawer */
    .sidebar-nav {
        position: fixed;
        top: 0;
        left: -100%;
        /* Hidden by default */
        width: 250px;
        height: 100vh;
        z-index: 1001;
        /* Above header */
        transition: left 0.3s ease;
        border-right: 1px solid var(--border-color);
        background: var(--bg-sidebar);
        flex-direction: column;
        display: flex !important;
    }

    .sidebar-nav.active {
        left: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    /* Show Logo in Drawer again for context */
    .sidebar-header,
    .logo {
        display: block !important;
    }

    .sidebar-menu {
        flex-direction: column;
        overflow-y: auto;
    }

    .nav-item {
        border-right: none;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 1rem 1.5rem;
    }

    .nav-item.active {
        border-right: 3px solid var(--accent);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        /* Reset border bottom */
    }

    /* Logout Button in Drawer */
    .sidebar-footer {
        display: block;
        margin: 0;
        border-top: 1px solid var(--border-color);
        padding: 1.5rem;
    }

    .btn-logout {
        width: 100%;
        padding: 0.8rem;
    }

    .btn-logout span {
        display: inline;
    }

    /* Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Adjust Main Content padding since header is fixed */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 1rem;
    }

    /* Hide Logout Footer text, keep icon if needed or hide entirely */
    .sidebar-footer {
        border-top: none;
        padding: 0;
        margin-left: auto;
        /* Push to right */
        display: block;
    }

    .btn-logout {
        border: none;
        padding: 0.5rem;
        width: auto;
    }

    .btn-logout span {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 1rem;
    }

    /* Mobile Layout Optimizations */
    .page-header {
        margin-bottom: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Force 3 columns */
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 0.75rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin: 0 auto;
    }

    .stat-info .label {
        font-size: 0.7rem;
    }

    .stat-info .value {
        font-size: 1.1rem;
    }

    /* Compress Slot Machine */
    .slot-machine-container {
        padding: 1rem;
    }

    .slot-window {
        height: 100px;
        margin: 1rem auto;
    }

    .reel {
        width: 60px;
        height: 70px;
        font-size: 2rem;
    }

    .btn-spin {
        padding: 0.8rem 3rem;
        font-size: 1.2rem;
    }
}