/* =====================================================
   HABITWAR - Premium Habit Tracker Stylesheet
   Design System + Component Styles + Responsive Layout
   ===================================================== */

/* =====================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ===================================================== */
:root {
    /* Light Theme Colors (Default) */
    --sidebar-bg: #0f0f1a;
    --sidebar-bg-hover: #1a1a2e;
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    
    /* Accent Colors */
    --accent-lime: #c5ff00;
    --accent-lime-hover: #d4ff40;
    --accent-lime-dark: #9acc00;
    --accent-glow: rgba(197, 255, 0, 0.3);
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-light: #ffffff;
    --text-muted: #cbd5e1;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);
    
    /* Category Colors */
    --category-health: #22c55e;
    --category-productivity: #8b5cf6;
    --category-social: #ec4899;
    --category-finance: #f59e0b;
    --category-spiritual: #06b6d4;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 30px var(--accent-glow);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 70px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =====================================================
   DARK THEME OVERRIDES
   ===================================================== */
body[data-theme="dark"] {
    /* Dark Theme Colors */
    --sidebar-bg: #0a0a0f;
    --sidebar-bg-hover: #14141f;
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --bg-dark: #050508;
    
    /* Text Colors for Dark Mode */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;
    
    /* Adjusted Shadows for Dark Mode */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    
    /* Enhanced Accent Glow for Dark Mode */
    --accent-glow: rgba(197, 255, 0, 0.4);
}

/* Dark mode particles background */
body[data-theme="dark"] #particles-js {
    background: linear-gradient(135deg, #0a0a0f 0%, #0f0f1a 50%, #0a0a0f 100%);
}

/* Light mode particles background */
body:not([data-theme="dark"]) #particles-js {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
}

/* Theme transition for smooth switching */
body,
body *:not(.loader-ring) {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100dvh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* =====================================================
   PARTICLES BACKGROUND
   ===================================================== */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%);
}

/* =====================================================
   LAYOUT - SIDEBAR
   ===================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100dvh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-base);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-lime) 0%, var(--accent-lime-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: var(--sidebar-bg);
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

.close-sidebar {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.close-sidebar:hover {
    background: var(--sidebar-bg-hover);
    color: var(--text-light);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-lg) 0;
    overflow-y: auto;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: 0 var(--space-md);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: all var(--transition-fast);
}

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

.nav-link:hover {
    background: var(--sidebar-bg-hover);
    color: var(--text-light);
}

.nav-item.active .nav-link {
    background: linear-gradient(135deg, var(--accent-lime) 0%, var(--accent-lime-dark) 100%);
    color: var(--sidebar-bg);
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.nav-item.active .nav-link svg {
    color: var(--sidebar-bg);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--sidebar-bg-hover);
    border-radius: var(--radius-md);
}

.avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-lime) 0%, var(--accent-lime-dark) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar svg {
    width: 22px;
    height: 22px;
    color: var(--sidebar-bg);
}

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

.user-name {
    font-weight: 600;
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

.user-status {
    font-size: var(--font-size-xs);
    color: var(--accent-lime);
}

/* =====================================================
   LAYOUT - MAIN CONTENT
   ===================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    height: var(--header-height);
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hamburger-menu {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.hamburger-menu:hover {
    background: var(--accent-lime);
    color: var(--sidebar-bg);
}

.hamburger-menu svg {
    width: 24px;
    height: 24px;
}

.header-greeting {
    flex: 1;
}

.greeting-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.warrior-name {
    color: var(--accent-lime-dark);
}

.greeting-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--accent-lime);
    color: var(--sidebar-bg);
    transform: scale(1.05);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Container */
.content-container {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
}

.page-content {
    animation: fadeIn 0.3s ease;
}

/* =====================================================
   LOADING STATE
   ===================================================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--space-lg);
}

.loader {
    position: relative;
    width: 60px;
    height: 60px;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent-lime);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--accent-lime-dark);
    animation-duration: 0.8s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--success);
    animation-duration: 0.6s;
}

.loading-state p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--space-md);
    text-align: center;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: var(--danger-light);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon svg {
    width: 40px;
    height: 40px;
    color: var(--danger);
}

.error-state h2 {
    color: var(--text-primary);
    font-size: var(--font-size-xl);
}

.error-state p {
    color: var(--text-secondary);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-lime) 0%, var(--accent-lime-dark) 100%);
    color: var(--sidebar-bg);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-dark);
    color: var(--text-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: var(--font-size-base);
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Stat Cards */
.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-lime);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

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

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

.stat-icon.lime {
    background: rgba(197, 255, 0, 0.15);
    color: var(--accent-lime-dark);
}

.stat-icon.success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-icon.info {
    background: var(--info-light);
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
    font-weight: 600;
    margin-top: var(--space-xs);
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* =====================================================
   STATS GRID
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* =====================================================
   HABIT LIST
   ===================================================== */
.habits-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.habit-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
}

.habit-item:hover {
    border-color: var(--accent-lime);
    transform: translateX(4px);
}

.habit-item.completed {
    background: linear-gradient(135deg, rgba(197, 255, 0, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: var(--success);
}

.habit-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.habit-item.completed .habit-checkbox {
    background: var(--success);
    border-color: var(--success);
}

.habit-checkbox svg {
    width: 16px;
    height: 16px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.habit-item.completed .habit-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.habit-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.habit-icon.health { background: rgba(34, 197, 94, 0.15); }
.habit-icon.productivity { background: rgba(139, 92, 246, 0.15); }
.habit-icon.social { background: rgba(236, 72, 153, 0.15); }
.habit-icon.finance { background: rgba(245, 158, 11, 0.15); }
.habit-icon.spiritual { background: rgba(6, 182, 212, 0.15); }

.habit-info {
    flex: 1;
}

.habit-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.habit-category {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.habit-streak {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--warning);
}

.habit-streak svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   CHARTS
   ===================================================== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container.small {
    height: 200px;
}

.chart-container.large {
    height: 400px;
}

/* =====================================================
   TABS
   ===================================================== */
.tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.tab-btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--bg-tertiary);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-lime);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--bg-tertiary);
}

.modal-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: 60vh;
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* =====================================================
   MOBILE OVERLAY
   ===================================================== */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: toastSlideIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

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

.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.warning svg { color: var(--warning); }

/* =====================================================
   GRATITUDE STYLES
   ===================================================== */
.gratitude-card {
    background: linear-gradient(135deg, rgba(197, 255, 0, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(197, 255, 0, 0.2);
}

.gratitude-entry {
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--accent-lime);
}

.gratitude-entry .date {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.gratitude-entry .content {
    color: var(--text-primary);
    line-height: 1.7;
}

/* =====================================================
   STREAK BADGES
   ===================================================== */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, var(--warning) 0%, #ea580c 100%);
    color: white;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.streak-badge svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   CALENDAR HEATMAP
   ===================================================== */
.calendar-heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-xs);
}

.heatmap-day {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.heatmap-day:hover {
    transform: scale(1.1);
}

.heatmap-day.level-0 { background: var(--bg-tertiary); }
.heatmap-day.level-1 { background: rgba(197, 255, 0, 0.25); }
.heatmap-day.level-2 { background: rgba(197, 255, 0, 0.5); }
.heatmap-day.level-3 { background: rgba(197, 255, 0, 0.75); }
.heatmap-day.level-4 { background: var(--accent-lime); }

/* =====================================================
   PROGRESS RING
   ===================================================== */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.progress-ring .bg {
    stroke: var(--bg-tertiary);
}

.progress-ring .progress {
    stroke: var(--accent-lime);
    stroke-dasharray: 339.292;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring .value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

/* =====================================================
   HABIT GRID
   ===================================================== */
.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.habit-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
    border: 2px solid transparent;
}

.habit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-lime);
}

.habit-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.habit-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.habit-card-title {
    font-weight: 700;
    color: var(--text-primary);
}

.habit-card-category {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.habit-card-progress {
    margin-top: var(--space-md);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-lime) 0%, var(--success) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: var(--space-sm);
}

/* =====================================================
   GRID LAYOUTS
   ===================================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

/* =====================================================
   PAGE HEADERS
   ===================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: var(--shadow-glow); }
    50% { box-shadow: 0 0 50px var(--accent-glow); }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

/* Large Desktops */
@media (min-width: 1440px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

/* Small Laptops */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .close-sidebar {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .hamburger-menu {
        display: flex;
    }
    
    .header-greeting {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-container {
        padding: var(--space-md);
    }
    
    .habits-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main-header {
        padding: 0 var(--space-md);
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .stat-card {
        padding: var(--space-md);
    }
    
    .stat-value {
        font-size: var(--font-size-xl);
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .hamburger-menu,
    .header-actions,
    .mobile-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
}
