/**
 * BudgetBot Design System - Web3/DeFi Theme
 * Professional dual-theme (light/dark) design
 */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

:root {
    /* Brand Colors - Theme Independent */
    --brand-primary: #8b5cf6;        /* Purple - DeFi primary */
    --brand-primary-hover: #7c3aed;
    --brand-primary-light: #a78bfa;
    --brand-secondary: #06b6d4;      /* Cyan - Crypto accent */
    --brand-accent: #f59e0b;         /* Gold - Token/coin color */
    --brand-danger: #ef4444;
    --brand-warning: #f97316;
    --brand-success: #10b981;        /* Green - Profit color */
    --brand-info: #06b6d4;
    
    /* Web3 Neon Accents */
    --neon-purple: #a855f7;
    --neon-cyan: #22d3ee;
    --neon-pink: #ec4899;
    --neon-green: #10b981;
    --neon-blue: #3b82f6;
    
    /* Semantic Colors - Crypto Theme */
    --color-budget-over: #ef4444;    /* Red - Loss */
    --color-budget-warning: #f97316; /* Orange - Warning */
    --color-budget-caution: #eab308; /* Yellow - Caution */
    --color-budget-good: #10b981;    /* Green - Profit */
    
    /* Spacing - Modern Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius - Softer */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* Typography - Modern Scale */
    --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;
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   DARK THEME (Default)
   ======================================== */
html[data-theme="dark"] {
    /* Dark Mode Neutrals */
    --gray-50: #0f172a;              /* Near black */
    --gray-100: #1e293b;             /* Dark slate */
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    
    /* Theme-specific colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.2);
    
    /* Web3 Glow Shadows - Dark */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.3);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.7);
    --shadow-neon-purple: 0 0 20px rgba(168, 85, 247, 0.5), 0 0 40px rgba(168, 85, 247, 0.3);
    --shadow-neon-cyan: 0 0 20px rgba(34, 211, 238, 0.5), 0 0 40px rgba(34, 211, 238, 0.3);
    --shadow-neon-green: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 40px rgba(16, 185, 129, 0.3);
    
    /* Glassmorphism - Dark */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(148, 163, 184, 0.1);
    
    /* Gradient backgrounds - Dark */
    --gradient-bg-1: rgba(139, 92, 246, 0.2);
    --gradient-bg-2: rgba(6, 182, 212, 0.2);
    --gradient-bg-3: rgba(236, 72, 153, 0.1);
    --gradient-bg-4: rgba(16, 185, 129, 0.1);
}

/* ========================================
   LIGHT THEME
   ======================================== */
html[data-theme="light"] {
    /* Light Mode Neutrals (Reversed) */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Theme-specific colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(30, 41, 59, 0.15);
    
    /* Subtle shadows - Light */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-neon-purple: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 40px rgba(139, 92, 246, 0.15);
    --shadow-neon-cyan: 0 0 20px rgba(6, 182, 212, 0.3), 0 0 40px rgba(6, 182, 212, 0.15);
    --shadow-neon-green: 0 0 20px rgba(16, 185, 129, 0.3), 0 0 40px rgba(16, 185, 129, 0.15);
    
    /* Glassmorphism - Light */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(30, 41, 59, 0.08);
    
    /* Gradient backgrounds - Light (more subtle) */
    --gradient-bg-1: rgba(139, 92, 246, 0.08);
    --gradient-bg-2: rgba(6, 182, 212, 0.08);
    --gradient-bg-3: rgba(236, 72, 153, 0.05);
    --gradient-bg-4: rgba(16, 185, 129, 0.05);
}

/* Web3/DeFi Base Styles with Theme Support */
* {
    transition: background-color var(--transition-slow), 
                color var(--transition-slow), 
                border-color var(--transition-slow),
                box-shadow var(--transition-slow);
}

/* Accessibility: Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--brand-primary);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    z-index: 9999;
    font-weight: 600;
}

.skip-to-content:focus {
    top: 0;
    outline: 3px solid var(--neon-cyan);
    outline-offset: 2px;
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Improved focus states for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[role="button"]:focus {
    outline: 3px solid var(--neon-purple);
    outline-offset: 2px;
}

/* Focus visible (keyboard only, not mouse clicks) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--neon-cyan);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, var(--gradient-bg-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--gradient-bg-2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--gradient-bg-3) 0px, transparent 50%),
        radial-gradient(at 0% 100%, var(--gradient-bg-4) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
}

/* Page load animation */
main {
    animation: fadeIn 0.4s ease-out;
}

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

/* Animated gradient background */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Web3/DeFi Typography */
h1, h2, h3, h4, h5, h6 {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-md);
}

h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: var(--font-size-sm); }
.text-large { font-size: var(--font-size-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

/* Web3/DeFi Glassmorphism Cards */
article, .card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

article:hover, .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-neon-purple);
    border-color: rgba(168, 85, 247, 0.3);
}

/* Web3/DeFi Button Styles with Neon Glow */
button, [role="button"], input[type="submit"], .button {
    transition: all var(--transition-base);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

button::before, [role="button"]::before, input[type="submit"]::before, .button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before, [role="button"]:hover::before, input[type="submit"]:hover::before, .button:hover::before {
    left: 100%;
}

button:hover, [role="button"]:hover, input[type="submit"]:hover, .button:hover {
    box-shadow: var(--shadow-neon-purple);
    transform: translateY(-2px);
    border-color: rgba(168, 85, 247, 0.5);
}

button:active, [role="button"]:active, input[type="submit"]:active, .button:active {
    transform: translateY(0);
}

/* Button variants */
button.secondary {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    box-shadow: 0 2px 8px 0 rgba(71, 85, 105, 0.3);
    color: var(--text-primary);
    border-color: var(--border-color);
}

button.secondary:hover {
    box-shadow: 0 4px 12px 0 rgba(71, 85, 105, 0.4);
}

/* Button states */
button:disabled,
button[aria-disabled="true"],
[role="button"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button:disabled:hover,
button[aria-disabled="true"]:hover {
    transform: none;
}

/* Loading button state */
button.loading,
button[aria-busy="true"] {
    position: relative;
    color: transparent;
    pointer-events: none;
}

button.loading::after,
button[aria-busy="true"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

button.success {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    color: var(--gray-900);
    box-shadow: 0 4px 14px 0 rgba(148, 163, 184, 0.2);
}

button.secondary:hover {
    box-shadow: 0 4px 14px 0 rgba(148, 163, 184, 0.4);
}

button.success {
    background: linear-gradient(135deg, var(--brand-success), #059669);
    box-shadow: var(--shadow-neon-green);
}

button.danger {
    background: linear-gradient(135deg, var(--brand-danger), #dc2626);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.4);
}

button.small, .btn-small {
    padding: 0.375rem 0.875rem;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

button.large, .btn-large {
    padding: 0.875rem 1.75rem;
    font-size: var(--font-size-lg);
    border-radius: var(--radius-lg);
}

/* Web3/DeFi Input Styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--neon-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15), 0 0 20px rgba(168, 85, 247, 0.2);
    background: var(--bg-secondary);
}

/* Web3/DeFi Status Badges with Neon Glow */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    gap: 0.375rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--neon-green);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--brand-accent);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--brand-danger);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.badge-info {
    background: rgba(34, 211, 238, 0.2);
    color: var(--neon-cyan);
    border-color: rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.2);
}

/* Web3/DeFi Progress Bars with Neon Glow */
.progress {
    height: 24px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.progress-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
    transition: width var(--transition-slow);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

.progress-bar.danger {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.progress-bar.warning {
    background: linear-gradient(90deg, #ea580c, #f97316);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
}

.progress-bar.success {
    background: linear-gradient(90deg, #10b981, #22c55e);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* Web3/DeFi Table Enhancements */
table {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

table thead {
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

table tbody tr {
    transition: background-color var(--transition-fast);
}

table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

table th {
    font-weight: 600;
    color: #374151;
}

/* Form Enhancements */
input, select, textarea {
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-help {
    font-size: var(--font-size-sm);
    color: #6b7280;
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--font-size-sm);
    color: var(--brand-danger);
    margin-top: var(--space-xs);
}

/* Alert Boxes */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid;
}

/* Web3/DeFi Alert Components */
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--neon-green);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--brand-accent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--brand-danger);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.alert-info {
    background: rgba(34, 211, 238, 0.15);
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: var(--neon-cyan);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Web3/DeFi Dashboard Widgets */
.widget {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-md);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-base);
}

.widget:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: var(--shadow-neon-purple);
    transform: translateY(-2px);
}

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

.widget-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0;
}

.widget-stat {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--brand-primary);
    margin: var(--space-sm) 0;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

.fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn var(--transition-base) ease-out;
}

/* Modal Improvements */
dialog {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    margin-bottom: var(--space-xs);
    z-index: 1000;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-2xl);
    color: var(--text-muted);
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    margin: var(--space-lg) 0;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.6;
    filter: grayscale(0.3);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.empty-state-action {
    margin-top: var(--space-lg);
}

/* Net Worth Change */
.net-worth-change {
    font-weight: bold;
}

/* Action Priority */
.action-priority {
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    border-left-width: 3px;
}
.action-priority.high {
    border-color: var(--brand-danger);
}
.action-priority.medium {
    border-color: var(--brand-warning);
}
.action-priority.low {
    border-color: var(--brand-success);
}

/* Net Worth Summary */
.net-worth-summary {
    font-size: var(--font-size-3xl);
    font-weight: bold;
}
.net-worth-summary.positive {
    color: var(--brand-success);
}
.net-worth-summary.negative {
    color: var(--brand-danger);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none;
    }
}

/* Print Styles */
@media print {
    nav, footer, button, .no-print {
        display: none !important;
    }
    
    article, .card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}

/* Web3/DeFi Navigation with Glassmorphism */
nav {
    background: var(--glass-bg);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

nav a {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    border: 1px solid transparent;
}

nav a:hover {
    background: rgba(168, 85, 247, 0.1);
    color: var(--neon-purple);
    text-decoration: none;
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

nav a.active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    box-shadow: var(--shadow-neon-purple);
}

/* Modern Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Web3/DeFi Stats Cards with Crypto Ticker Style */
.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-neon-purple);
    border-color: rgba(168, 85, 247, 0.4);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-bold);
    background: linear-gradient(135deg, var(--gray-700), var(--gray-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: var(--space-xs);
    font-family: 'Courier New', monospace;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-semibold);
    margin-top: var(--space-sm);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.stat-change.positive {
    color: var(--neon-green);
    background: rgba(16, 185, 129, 0.15);
}

.stat-change.negative {
    color: var(--brand-danger);
    background: rgba(239, 68, 68, 0.15);
}

/* Modern Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Modern Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Mobile navigation */
    nav ul {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    nav li {
        margin: 0;
    }
    
    /* Hide nav text on mobile, keep icons */
    .nav-text {
        display: none;
    }
    
    /* Make buttons touch-friendly */
    button, [role="button"], a[role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Stack grid columns on mobile */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Reduce padding on mobile */
    .container {
        padding: 0.5rem;
    }
    
    article, .card {
        padding: 1rem;
    }
    
    /* Stat cards - 2 columns on mobile */
    [style*="grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
    }
    
    .stat-value {
        font-size: 1.5rem !important;
    }
    
    /* Tables - make scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Form inputs - full width */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Charts - adjust height */
    canvas {
        max-height: 250px !important;
    }
    
    /* AI Command Box - adjust for mobile */
    .ai-command-container {
        margin: -0.5rem -0.5rem 1rem -0.5rem;
        padding: 1rem 0.5rem;
    }
    
    .ai-command-input {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Single column on very small screens */
    [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    
    .stat-card {
        padding: 0.75rem !important;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-text {
        display: inline;
    }
}

/* Touch Device Improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    a, button, [role="button"] {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem 1.25rem;
    }
    
    /* Remove hover effects on touch */
    article:hover, .card:hover, .widget:hover {
        transform: none;
    }
}

/* Print Styles for Lighthouse */
@media print {
    nav, footer, button, .no-print, .ai-command-container {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    article, .card {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

.form-help {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Modern Details/Summary */
details {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

details:hover {
    box-shadow: var(--shadow-md);
}

details[open] {
    box-shadow: var(--shadow-lg);
}

summary {
    cursor: pointer;
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    font-size: var(--font-size-lg);
    padding: var(--space-sm);
    margin: calc(var(--space-lg) * -1);
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

summary:hover {
    background: var(--bg-secondary);
    color: var(--brand-primary);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Modern Alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    animation: slideInFromTop 0.3s ease-out;
    position: relative;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert::before {
    content: '';
    font-size: 1.5rem;
    line-height: 1;
}

.alert-success::before {
    content: '✓';
}

.alert-warning::before {
    content: '⚠';
}

.alert-danger::before {
    content: '✕';
}

.alert-info::before {
    content: 'ℹ';
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--brand-success);
    color: var(--brand-success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--brand-warning);
    color: var(--brand-warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--brand-danger);
    color: var(--brand-danger);
}

.alert-info {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--brand-info);
    color: var(--brand-info);
}

/* Chart Enhancements */
canvas {
    transition: filter 0.3s ease;
}


canvas:hover {
    filter: brightness(1.05);
}

#netWorthChart {
    cursor: crosshair !important;
}

/* Theme Toggle Button Styling */
#themeToggle {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    transition: all var(--transition-base) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#themeToggle:hover {
    background: var(--bg-secondary) !important;
    box-shadow: var(--shadow-md) !important;
    transform: scale(1.05);
}

#themeToggle:active {
    transform: scale(0.95);
}



