/*
================================================================================
| ROOBUX - NEW DESIGN SYSTEM v3.0 | dashboard.css (Desktop-Only)
================================================================================
| Core layout for all authenticated user pages.
|
| v3.7 CHANGELOG:
| - ADDED: Styles for Bonus Notification Card (Time-limited offer).
| - ADDED: Styles for Floating Bonus Button (Fab).
| - FIXED: Chart height set to 175px.
| - FIXED: Price widget list is now STATIC.
================================================================================
*/

/* --- 1. DASHBOARD LAYOUT --- */
:root {
    --sidebar-width: 260px;
    --header-height: 80px;
}

.dashboard-layout {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--color-bg);
}

/* --- 2. SIDEBAR --- */
.dashboard-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 28, 0.7); /* Glass-Card BG */
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--color-border);
    padding: var(--space-lg);
    z-index: var(--z-sidebar);
    transition: transform var(--transition-medium);
}

.sidebar-header {
    text-align: center;
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text-primary);
    text-decoration: none;
}
.sidebar-logo:hover {
    text-decoration: none;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
}
.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.sidebar-nav-list a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.875rem var(--space-lg); /* 14px 24px */
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 1;
    border-left: 3px solid transparent;
}
.sidebar-nav-list a .nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}
.sidebar-nav-list a:hover {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border-left-color: var(--color-primary);
}

.sidebar-nav-list a.active {
    background: linear-gradient(90deg, var(--color-primary-light), transparent);
    color: var(--color-primary);
    font-weight: 600;
    border-left-color: var(--color-primary);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.sidebar-footer {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-lg);
}
.sidebar-footer .btn {
    width: 100%;
}

/* --- 3. DASHBOARD MAIN CONTENT --- */
.dashboard-main {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

/* --- 4. DASHBOARD HEADER --- */
.dashboard-header {
    height: var(--header-height);
    background: rgba(14, 14, 20, 0.8); /* Glass BG */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}
.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}
.mobile-menu-toggle {
    display: none; /* Hidden by default */
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.mobile-menu-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.welcome-message h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text-primary);
}
.welcome-message p { /* Account Status */
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}
.dashboard-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* --- 5. NOTIFICATION BELL --- */
.notification-bell {
    position: relative;
}
.notification-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.notification-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}
.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background-color: var(--color-error);
    border-radius: 50%;
    border: 2px solid var(--color-bg-elevated);
    display: none; /* Hidden by default */
    font-size: 0;
    color: transparent;
    text-indent: -9999px;
}
.notification-badge.visible {
    display: block;
    animation: pulse-badge 1.5s infinite;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    background-color: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: calc(var(--z-modal) + 1); /* Higher than modal overlay */
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}
.notification-dropdown.visible {
    display: block;
}
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}
.notification-header h5 {
    margin: 0;
    font-size: 1rem;
}
.notification-list {
    max-height: 350px;
    overflow-y: auto;
}
.notification-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item:hover {
    background-color: var(--color-bg-main);
}
.notification-item.unread {
    background-color: var(--color-primary-light);
}
.notification-icon {
    font-size: 1.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}
.notification-content p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.4;
}
.notification-content small {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.notification-empty {
    padding: var(--space-xl);
    text-align: center;
    color: var(--color-text-muted);
}
.notification-footer {
    padding: var(--space-sm);
    text-align: center;
    border-top: 1px solid var(--color-border);
}
.notification-footer .btn-link {
    font-size: 0.9rem;
}

/* --- 6. USER AVATAR --- */
.user-avatar-btn {
    display: block;
    cursor: pointer;
    border-radius: 50%;
}
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    transition: all var(--transition-fast);
    object-fit: cover;
}
.user-avatar-btn:hover .user-avatar {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

/* --- 7. DASHBOARD CONTENT & BASE STYLES --- */
.dashboard-content {
    padding: var(--space-xl);
    position: relative;
}

/* FIX: Target the grid holding the two bottom tables */
.dashboard-content > .d-grid {
    align-items: stretch;
}

.dashboard-content .card::before {
    display: none; /* Disable the background glow */
}
.dashboard-content .card:hover {
    border-color: var(--color-primary); /* Add border highlight */
    box-shadow: var(--shadow-glow-primary); /* Use the glow shadow */
}


/*
 * -----------------------------------------------------------------
 * [NEW] BONUS NOTIFICATION CARD
 * -----------------------------------------------------------------
 */
#bonus-notification-card {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    animation: slideDown 0.5s ease-out;
    border: 1px solid rgba(255, 215, 0, 0.5);
}
/* Shine effect */
#bonus-notification-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shine 3s infinite;
}

.bonus-content {
    flex: 1;
    z-index: 2;
}

.bonus-content h3 {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
}

.bonus-content p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    color: #000;
}

.bonus-timer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    z-index: 2;
}

.timer-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bonus-close-btn {
    background: transparent;
    border: none;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: absolute;
    top: 10px;
    right: 10px;
    transition: background 0.2s;
    z-index: 2;
}
.bonus-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Floating Action Button (FAB) */
#floating-bonus-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff0080, #7928ca);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(121, 40, 202, 0.5);
    cursor: pointer;
    z-index: 9999;
    animation: pulse-float 2s infinite;
    transition: transform 0.3s;
}
#floating-bonus-btn:hover {
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

@keyframes shine {
    100% { left: 100%; }
}
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes pulse-float {
    0% { box-shadow: 0 0 0 0 rgba(121, 40, 202, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(121, 40, 202, 0); }
    100% { box-shadow: 0 0 0 0 rgba(121, 40, 202, 0); }
}
/* ----------------------------------------------------------------- */


/* --- 8. STAT CARDS --- */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 1x4 on desktop */
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}
.stat-card {
    padding: var(--space-lg);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}
.stat-card-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}
.stat-card-icon {
    font-size: 1.5rem;
    color: var(--color-primary);
}
.stat-card-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
    margin-bottom: var(--space-md);
}
.stat-card-footer {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.stat-card-footer .positive {
    color: var(--color-success);
    font-weight: 500;
}
.stat-card-footer .negative {
    color: var(--color-error);
    font-weight: 500;
}

/* Base Table Style */
.table-container {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: var(--space-xl);
    
    display: flex; /* Make container flex */
    flex-direction: column; /* Stack header and wrapper */
    height: 100%; /* Ensure it fills the grid cell */
}
.table-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.table-header h4 {
    margin: 0;
    font-size: 1.25rem;
}
.table-wrapper {
    overflow-x: auto;
    flex-grow: 1;
    overflow-y: auto;
}
.table-wrapper::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}
.table-wrapper::-webkit-scrollbar-track {
    background: var(--color-bg-main);
    border-radius: 0 0 var(--radius-lg) 0;
}
.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated);
    border-radius: 4px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.responsive-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}
.responsive-table th,
.responsive-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.responsive-table th {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--color-bg-main);
}
.responsive-table tr:last-child td {
    border-bottom: none;
}
.responsive-table tbody tr:hover {
    background-color: var(--color-bg-elevated);
}
.responsive-table .text-primary {
    color: var(--color-text-primary);
    font-weight: 500;
}
.responsive-table .text-success { color: var(--color-success); }
.responsive-table .text-error   { color: var(--color-error); }
.responsive-table .text-warning { color: var(--color-warning); }

.empty-table-state {
    text-align: center;
    padding: var(--space-xxl) !important;
    color: var(--color-text-muted);
    font-size: 1rem;
}
.empty-table-state .btn-link {
    font-size: 1rem;
}
.text-crypto {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.text-crypto .icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--color-bg-main);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
}


/* --- 9. DASHBOARD-SPECIFIC STYLES --- */
.dashboard-grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    align-items: stretch;
}

.card .chart-container {
    height: 175px; 
    position: relative;
}

.tabs-sm {
    display: flex;
    background-color: var(--color-bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.tab-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    border-left: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.tab-btn:first-child {
    border-left: none;
}
.tab-btn:hover {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-primary);
}
.tab-btn.active {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.price-widget-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.price-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: var(--color-bg-card);
}
.price-widget-header h4 {
    margin: 0;
    font-size: 1.125rem;
}
.price-widget-list {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-grow: 1;
}

.crypto-price-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: var(--space-md);
    align-items: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    padding: 0 var(--space-sm);
}
.crypto-price-item .name {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}
.crypto-price-item .icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.crypto-price-item .price {
    font-weight: 500;
    color: var(--color-text-secondary);
    text-align: right;
}
.crypto-price-item .change {
    font-weight: 600;
    text-align: right;
    min-width: 60px;
}

/* --- 10. BADGES --- */
.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    line-height: 1.2;
}
.badge-success {
    background-color: var(--color-success-light);
    color: var(--color-success);
}
.badge-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning);
}
.badge-error {
    background-color: var(--color-error-light);
    color: var(--color-error);
}
.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}
.badge-secondary {
    background-color: var(--color-bg-elevated);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}


/* --- 11. RESPONSIVE (MOBILE DASHBOARD) --- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 199;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-medium);
}
.sidebar-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* --- 12. SCROLLBARS --- */
.dashboard-main::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.notification-list::-webkit-scrollbar,
.price-widget-list::-webkit-scrollbar {
    width: 8px;
}
.dashboard-main::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.notification-list::-webkit-scrollbar-track,
.price-widget-list::-webkit-scrollbar-track {
    background: var(--color-bg-main);
}
.dashboard-main::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.notification-list::-webkit-scrollbar-thumb,
.price-widget-list::-webkit-scrollbar-thumb {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-sm);
}
.dashboard-main::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.notification-list::-webkit-scrollbar-thumb:hover,
.price-widget-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Mega Jackpot Card Styling */
#refund-entry-card {
    border: 2px solid #FFD700 !important;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(20, 20, 28, 0.9)) !important;
    overflow: hidden;
    position: relative;
}

#refund-entry-card .card-body {
    padding: var(--space-lg);
    position: relative;
    z-index: 2;
}

#refund-entry-card .d-flex {
    flex-wrap: wrap;
    gap: 16px;
}

#refund-entry-card h4 {
    color: #FFD700 !important;
    font-size: 1.4rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

#refund-entry-card p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-primary);
}

#refund-entry-card .btn {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #000 !important;
    font-weight: 700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4) !important;
    border: none !important;
}

#refund-entry-card .jackpot-glow {
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Mobile-only centering */
@media (max-width: 768px) {
    #refund-entry-card .d-flex {
        flex-direction: column !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    #refund-entry-card h4 {
        justify-content: center !important;
    }
    
    #refund-entry-card .btn {
        width: 100% !important;
    }
}