/* =====================================================
   Dashboard Styles
   ===================================================== */

.dashboard-page {
    display: flex;
    min-height: 100vh;
    background: var(--bg-dark);
}

/* =====================================================
   Sidebar
   ===================================================== */

.sidebar {
    width: 280px;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition-base);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo svg {
    width: 36px;
    height: 36px;
}

.sidebar-logo span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    transition: var(--transition-base);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.logout-btn:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent-rose);
}

/* =====================================================
   Main Content
   ===================================================== */

.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
}

/* =====================================================
   Top Bar
   ===================================================== */

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 32px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.topbar-search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.topbar-search input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.notification-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-rose);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =====================================================
   Dashboard Content
   ===================================================== */

.dashboard-content {
    padding: 32px;
}

.dashboard-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard-section.active {
    display: block;
}

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-muted);
}

/* =====================================================
   Stats Grid
   ===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    gap: 16px;
    transition: var(--transition-base);
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-icon.subscription {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary-light);
}

.stat-icon.scores {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.stat-icon.draws {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-gold);
}

.stat-icon.charity {
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
}

.stat-content h3 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================
   Quick Actions
   ===================================================== */

.quick-actions {
    margin-bottom: 32px;
}

.quick-actions h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-base);
}

.action-card:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

.action-icon svg {
    width: 24px;
    height: 24px;
}

.action-card span {
    font-weight: 500;
    color: var(--text-secondary);
}

/* =====================================================
   Upcoming Draw
   ===================================================== */

.upcoming-draw h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.draw-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.draw-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.draw-info h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.draw-date {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.draw-countdown-mini {
    display: flex;
    gap: 16px;
}

.countdown-item {
    text-align: center;
}

.countdown-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.countdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.draw-prize {
    text-align: right;
}

.prize-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.prize-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-gold);
}

/* =====================================================
   Form Row
   ===================================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* =====================================================
   Add Score Card
   ===================================================== */

.add-score-card {
    margin-bottom: 24px;
}

.add-score-card h3 {
    margin-bottom: 20px;
}

.add-score-card form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.add-score-card .form-group {
    margin-bottom: 0;
}

/* =====================================================
   Scores List Card
   ===================================================== */

.scores-list-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.scores-list-card h3 {
    margin: 0;
}

/* Numbers Display */
.numbers-mini {
    display: flex;
    gap: 4px;
}

.numbers-mini span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.numbers-display {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.number-ball {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-darker);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
}

.draw-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================
   Empty State
   ===================================================== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =====================================================
   Charity Card
   ===================================================== */

.charity-card {
    margin-bottom: 24px;
}

.charity-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.charity-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(244, 63, 94, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.charity-info {
    flex: 1;
}

.charity-info h3 {
    margin-bottom: 4px;
}

.charity-info p {
    color: var(--accent-rose);
    font-size: 0.9rem;
}

.charity-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.charity-stat {
    text-align: center;
}

.charity-stat .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.charity-stat .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-green);
}

/* =====================================================
   Impact Timeline
   ===================================================== */

.impact-timeline {
    margin-top: 16px;
}

.impact-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.impact-item:last-child {
    border-bottom: none;
}

.impact-date {
    width: 120px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.impact-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.impact-amount {
    font-weight: 600;
    color: var(--accent-green);
}

.impact-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =====================================================
   Winnings Summary
   ===================================================== */

.winnings-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
}

.summary-value.pending {
    color: var(--accent-gold);
}

.summary-value.success {
    color: var(--accent-green);
}

/* =====================================================
   Subscription Card
   ===================================================== */

.subscription-card .plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.subscription-card .plan-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.plan-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-detail .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.plan-detail .value {
    font-weight: 600;
}

.plan-actions {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   Settings
   ===================================================== */

.settings-form {
    max-width: 500px;
}

.notification-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-darker);
    border-radius: 10px;
    cursor: pointer;
}

.setting-item span strong {
    display: block;
    margin-bottom: 4px;
}

.setting-item span small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.setting-item input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

/* =====================================================
   Current Draw Card
   ===================================================== */

.current-draw-card .draw-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.draw-numbers {
    flex: 1;
}

.draw-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.draw-stats {
    display: flex;
    gap: 32px;
}

.draw-stat {
    text-align: right;
}

.draw-stat .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.draw-stat .value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 1200px) {
    .stats-grid,
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .draw-card {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
    
    .draw-prize {
        text-align: center;
    }
    
    .winnings-summary {
        grid-template-columns: 1fr;
    }
    
    .current-draw-card .draw-details {
        flex-direction: column;
        gap: 24px;
    }
    
    .draw-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .draw-stat {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .dashboard-content {
        padding: 16px;
    }
    
    .stats-grid,
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row,
    .subscription-card .plan-details {
        grid-template-columns: 1fr;
    }
    
    .add-score-card form {
        grid-template-columns: 1fr;
    }
    
    .charity-stats {
        grid-template-columns: 1fr;
    }
    
    .topbar-search {
        display: none;
    }
    
    .user-info {
        display: none;
    }
}
