@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ====== ROOT CONFIGURATION ====== */
:root {
    --topbar-height: 70px;
    --topbar-height-mobile: 60px;
    --mobile-panel-width: 320px;
    --dropdown-width: 360px;
    --search-width: 280px;
    --animation-speed: 300ms;
    --animation-curve: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== AT THE RIVER LIGHT THEME (DEFAULT) ====== */
:root {
    /* Border Radius System - Material Design Inspired */
    --radius-factor: 1;
    --border-radius-xs: calc(0.25rem * var(--radius-factor));
    --border-radius-sm: calc(0.375rem * var(--radius-factor));
    --border-radius-md: calc(0.5rem * var(--radius-factor));
    --border-radius-lg: calc(0.75rem * var(--radius-factor));
    --border-radius-xl: calc(1rem * var(--radius-factor));
    --border-radius-2xl: calc(1.25rem * var(--radius-factor));
    --border-radius-3xl: calc(1.5rem * var(--radius-factor));
    --border-radius-pill: 9999px;
    --border-radius-circle: 50%;
    /* Base RGB Values for Alpha Transparency */
    --primary-rgb: 212, 175, 55; /* Gold */
    --secondary-rgb: 25, 25, 25; /* Rich Black */
    --tertiary-rgb: 250, 246, 240; /* Cream */
    --success-rgb: 34, 197, 94; /* Material Green */
    --danger-rgb: 239, 68, 68; /* Material Red */
    --warning-rgb: 251, 191, 36; /* Material Amber */
    --info-rgb: 59, 130, 246; /* Material Blue */
    --black-rgb: 0, 0, 0;
    --white-rgb: 255, 255, 255;
    --gray-50-rgb: 252, 252, 251;
    --gray-100-rgb: 248, 248, 246;
    --gray-200-rgb: 240, 238, 235;
    --gray-300-rgb: 220, 218, 215;
    --gray-400-rgb: 165, 162, 158;
    --gray-500-rgb: 115, 112, 108;
    --gray-600-rgb: 75, 73, 70;
    --gray-700-rgb: 55, 53, 50;
    --gray-800-rgb: 35, 33, 30;
    --gray-900-rgb: 20, 18, 15;
    /* Primary Brand Colors - Gold */
    --primary: #D4AF37;
    --primary-hover: #C19B1E;
    --primary-dark: #A68416;
    --primary-light: #F4E9C8;
    --primary-lighter: #FAF6E8;
    --primary-lightest: #FEFDF8;
    --primary-color: #D4AF37;
    --primary-color-detail: #000000;
    --primary-gradient: linear-gradient(135deg, #D4AF37, #E4C455);
    --primary-gradient-reverse: linear-gradient(135deg, #E4C455, #D4AF37);
    --primary-gradient-subtle: linear-gradient(135deg, #FAF6E8, #F4E9C8);
    /* Secondary Colors - Black */
    --secondary: #191919;
    --secondary-hover: #000000;
    --secondary-dark: #0A0A0A;
    --secondary-light: #2D2D2D;
    --secondary-lighter: #3A3A3A;
    --secondary-gradient: linear-gradient(90deg, #191919, #2D2D2D);
    /* Tertiary Colors - Cream */
    --tertiary: #FAF6F0;
    --tertiary-hover: #F5EDE0;
    --tertiary-dark: #EDE4D3;
    --tertiary-light: #FEFDFB;
    /* Success Colors - Material Green */
    --success: #22C55E;
    --success-hover: #16A34A;
    --success-dark: #15803D;
    --success-light: #E6F7ED;
    --success-lighter: #F3FBF6;
    --success-color: #22C55E;
    --success-bg: #E6F7ED;
    --success-border-light: #A3E4BC;
    --success-gradient: linear-gradient(90deg, #22C55E, #16A34A);
    /* Warning Colors - Material Amber */
    --warning: #FBBF24;
    --warning-hover: #F59E0B;
    --warning-dark: #D97706;
    --warning-light: #FEF5E7;
    --warning-lighter: #FFFBF3;
    --warning-gradient: linear-gradient(90deg, #FBBF24, #F59E0B);
    /* Danger Colors - Material Red */
    --danger: #EF4444;
    --danger-hover: #DC2626;
    --danger-dark: #B91C1C;
    --danger-light: #FEE8E8;
    --danger-lighter: #FFF3F3;
    --danger-color: #EF4444;
    --danger-bg: #FEE8E8;
    --danger-border-light: #F9B3B3;
    --danger-gradient: linear-gradient(90deg, #EF4444, #DC2626);
    /* Info Colors - Material Blue */
    --info: #3B82F6;
    --info-hover: #2563EB;
    --info-dark: #1D4ED8;
    --info-light: #E8F0FE;
    --info-lighter: #F4F8FF;
    --info-border-light: #A4C6FB;
    --info-gradient: linear-gradient(90deg, #3B82F6, #2563EB);
    /* Backgrounds - Cream and White Aesthetic */
    --body-bg: #FAF6F0;
    --sidebar-bg: #FFFFFF;
    --content-bg: #FFFFFF;
    --subtle-bg: #FEFDFB;
    --modal-bg: #FFFFFF;
    --dropdown-bg: #FFFFFF;
    --input-bg: #FFFFFF;
    --auth-bg: #FAF6F0;
    --auth-card-bg: #FFFFFF;
    --auth-overlay: #FEFDF8;
    --hover-bg: #FAF6F0;
    --pressed-bg: #F5EDE0;
    --selected-bg: #F4E9C8;
    --code-bg: #F8F8F6;
    --pre-bg: #FEFDFB;
    /* Text Colors - Black for Excellent Readability */
    --text-primary: #191919;
    --text-secondary: #4A4844;
    --text-muted: #737070;
    --text-light: #A5A29E;
    --text-disabled: #DCDAD8;
    --text-on-primary: #000000;
    --text-on-secondary: #FFFFFF;
    --text-on-dark: #FFFFFF;
    --text-link: #D4AF37;
    --text-link-hover: #A68416;
    --placeholder-color: #A5A29E;
    --text-inverse: #FFFFFF;
    /* Borders - Subtle and Clean */
    --border-color: #E5E3E0;
    --border-light: #F0EEEB;
    --border-lighter: #F8F6F4;
    --border-divider: #E5E3E0;
    --border-divider-light: #F0EEEB;
    --border-focus: #D4AF37;
    --border-error: #EF4444;
    --border-success: #22C55E;
    --border-warning: #FBBF24;
    /* Material Design Elevation Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-3xl: 0 35px 60px -15px rgba(0, 0, 0, 0.3);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-focus: 0 0 0 3px rgba(212, 175, 55, 0.2);
    --shadow-glow: 0 0 40px rgba(212, 175, 55, 0.15);
    /* Material Elevation Levels */
    --elevation-0: none;
    --elevation-1: 0 2px 1px -1px rgba(0,0,0,0.2), 0 1px 1px 0 rgba(0,0,0,0.14), 0 1px 3px 0 rgba(0,0,0,0.12);
    --elevation-2: 0 3px 1px -2px rgba(0,0,0,0.2), 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12);
    --elevation-3: 0 3px 3px -2px rgba(0,0,0,0.2), 0 3px 4px 0 rgba(0,0,0,0.14), 0 1px 8px 0 rgba(0,0,0,0.12);
    --elevation-4: 0 2px 4px -1px rgba(0,0,0,0.2), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12);
    --elevation-6: 0 3px 5px -1px rgba(0,0,0,0.2), 0 6px 10px 0 rgba(0,0,0,0.14), 0 1px 18px 0 rgba(0,0,0,0.12);
    --elevation-8: 0 5px 5px -3px rgba(0,0,0,0.2), 0 8px 10px 1px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12);
    --elevation-12: 0 7px 8px -4px rgba(0,0,0,0.2), 0 12px 17px 2px rgba(0,0,0,0.14), 0 5px 22px 4px rgba(0,0,0,0.12);
    --elevation-16: 0 8px 10px -5px rgba(0,0,0,0.2), 0 16px 24px 2px rgba(0,0,0,0.14), 0 6px 30px 5px rgba(0,0,0,0.12);
    --elevation-24: 0 11px 15px -7px rgba(0,0,0,0.2), 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12);
    /* Card Shadows */
    --card-shadow: var(--elevation-2);
    --card-shadow-hover: var(--elevation-8);
    --card-shadow-compact: var(--elevation-1);
    /* Status Indicators */
    --status-online: #22C55E;
    --status-stale: #FBBF24;
    --status-offline: #EF4444;
    --status-online-bg: #E6F7ED;
    --status-stale-bg: #FEF5E7;
    --status-offline-bg: #FEE8E8;
    /* Table Colors */
    --table-header-bg: #FEFDFB;
    --table-striped-bg: #FAF8F5;
    --table-hover-bg: #F5F2ED;
    --table-border-color: #E5E3E0;
    --table-selected-bg: #F4E9C8;
    /* Navigation Colors */
    --nav-hover: #FAF6F0;
    --nav-active: #F4E9C8;
    --nav-selected: #EBE0C0;
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    --glass-blur: 20px;
    /* Animation */
    --transition-faster: 100ms;
    --transition-fast: 150ms;
    --transition-normal: 250ms;
    --transition-slow: 350ms;
    --transition-slower: 500ms;
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --animation-timing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --animation-timing-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --hover-transition: all 0.2s var(--animation-timing);
    --card-transition: all 0.3s var(--animation-timing);
    --hover-scale: scale(1.02);
    --hover-lift: translateY(-2px);
    --pressed-scale: scale(0.98);
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    --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-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;
    --font-size-7xl: 4.5rem;
    --font-size-8xl: 6rem;
    --font-size-9xl: 8rem;
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    --font-black: 900;
    /* Line Heights */
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    /* Letter Spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;
    /* Spacing Scale */
    --spacing-0: 0;
    --spacing-px: 1px;
    --spacing-0-5: 0.125rem;
    --spacing-1: 0.25rem;
    --spacing-1-5: 0.375rem;
    --spacing-2: 0.5rem;
    --spacing-2-5: 0.625rem;
    --spacing-3: 0.75rem;
    --spacing-3-5: 0.875rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-7: 1.75rem;
    --spacing-8: 2rem;
    --spacing-9: 2.25rem;
    --spacing-10: 2.5rem;
    --spacing-11: 2.75rem;
    --spacing-12: 3rem;
    --spacing-14: 3.5rem;
    --spacing-16: 4rem;
    --spacing-20: 5rem;
    --spacing-24: 6rem;
    --spacing-28: 7rem;
    --spacing-32: 8rem;
    --spacing-36: 9rem;
    --spacing-40: 10rem;
    --spacing-44: 11rem;
    --spacing-48: 12rem;
    --spacing-52: 13rem;
    --spacing-56: 14rem;
    --spacing-60: 15rem;
    --spacing-64: 16rem;
    --spacing-72: 18rem;
    --spacing-80: 20rem;
    --spacing-96: 24rem;
    /* Z-index Scale */
    --z-negative: -1;
    --z-0: 0;
    --z-10: 10;
    --z-20: 20;
    --z-30: 30;
    --z-40: 40;
    --z-50: 50;
    --z-auto: auto;
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1100;
    --z-fixed: 1200;
    --z-sidebar: 1300;
    --z-drawer: 1400;
    --z-modal-backdrop: 1500;
    --z-modal: 1600;
    --z-popover: 1700;
    --z-tooltip: 1800;
    --z-toast: 1900;
    --z-notification: 2000;
    /* Layout */
    --header-height: 64px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 64px;
    --content-max-width: 1440px;
    --container-padding: var(--spacing-6);
    /* Focus */
    --focus-offset: 2px;
    --focus-width: 2px;
    --focus-ring: rgba(212, 175, 55, 0.3);
    --focus-ring-offset: 2px;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --overlay-blur: 8px;
    /* Scrollbar */
    --scroll-thumb: #DCDAD8;
    --scroll-thumb-hover: #A5A29E;
    --scroll-track: #F8F6F4;
    /* Backdrop Filters */
    --backdrop-blur-sm: 4px;
    --backdrop-blur: 8px;
    --backdrop-blur-md: 12px;
    --backdrop-blur-lg: 16px;
    --backdrop-blur-xl: 24px;
    /* Additional Material Colors */
    --surface-variant: #F8F6F4;
    --on-surface-variant: #4A4844;
    --outline: #DCDAD8;
    --outline-variant: #E5E3E0;
}

/* ====== AT THE RIVER DARK THEME ====== */
.theme-atriver-dark {
    /* RGB Values for Dark Theme */
    --primary-rgb: 212, 175, 55; /* Gold stays vibrant */
    --secondary-rgb: 250, 246, 240; /* Cream becomes secondary */
    --tertiary-rgb: 25, 25, 25; /* Black becomes tertiary */
    --success-rgb: 52, 211, 153;
    --danger-rgb: 248, 113, 113;
    --warning-rgb: 251, 191, 36;
    --info-rgb: 96, 165, 250;
    /* Primary Colors - Gold for Dark */
    --primary: #D4AF37;
    --primary-hover: #E4C355;
    --primary-dark: #C19B1E;
    --primary-light: #3A3419;
    --primary-lighter: #2A2512;
    --primary-lightest: #1F1A0D;
    --primary-color: #D4AF37;
    --primary-color-detail: #000000;
    --primary-gradient: linear-gradient(135deg, #D4AF37, #E4C355);
    --primary-gradient-reverse: linear-gradient(135deg, #E4C355, #D4AF37);
    --primary-gradient-subtle: linear-gradient(135deg, #2A2512, #3A3419);
    /* Secondary Colors - Black in dark mode */
    --secondary: #FAF6F0;
    --secondary-hover: #FFFFFF;
    --secondary-dark: #F5EDE0;
    --secondary-light: #3D3B38;
    --secondary-lighter: #2D2B28;
    /* Success Colors - Adjusted for Dark */
    --success: #34D399;
    --success-hover: #10B981;
    --success-dark: #059669;
    --success-light: #1A3A2A;
    --success-lighter: #122620;
    --success-bg: #1A3A2A;
    --success-border-light: #2D5F47;
    /* Warning Colors */
    --warning: #FBBF24;
    --warning-hover: #F59E0B;
    --warning-dark: #D97706;
    --warning-light: #3D3012;
    --warning-lighter: #2A200B;
    /* Danger Colors - Adjusted for Dark */
    --danger: #F87171;
    --danger-hover: #EF4444;
    --danger-dark: #DC2626;
    --danger-light: #3D1E1E;
    --danger-lighter: #2A1515;
    --danger-bg: #3D1E1E;
    --danger-border-light: #5F3333;
    /* Info Colors - Adjusted for Dark */
    --info: #60A5FA;
    --info-hover: #3B82F6;
    --info-dark: #2563EB;
    --info-light: #1E2A3D;
    --info-lighter: #151F2A;
    --info-border-light: #334E6B;
    /* Backgrounds - Elegant Dark */
    --body-bg: #0A0A0A;
    --sidebar-bg: #141414;
    --content-bg: #141414;
    --subtle-bg: #1A1A1A;
    --modal-bg: #141414;
    --dropdown-bg: #1A1A1A;
    --input-bg: #1A1A1A;
    --auth-bg: #050505;
    --auth-card-bg: #141414;
    --auth-overlay: #1F1A0D;
    --hover-bg: #1F1F1F;
    --pressed-bg: #252525;
    --selected-bg: #3A3419;
    --code-bg: #1F1F1F;
    --pre-bg: #1A1A1A;
    /* Text Colors - Optimized for Dark */
    --text-primary: #FAF6F0;
    --text-secondary: #DCDAD8;
    --text-muted: #A5A29E;
    --text-light: #737070;
    --text-disabled: #4A4844;
    --text-on-primary: #000000;
    --text-on-secondary: #000000;
    --text-on-dark: #000000;
    --text-link: #D4AF37;
    --text-link-hover: #E4C355;
    --placeholder-color: #737070;
    --text-inverse: #0A0A0A;
    /* Borders - Dark Theme */
    --border-color: #2D2D2D;
    --border-light: #1F1F1F;
    --border-lighter: #1A1A1A;
    --border-divider: #1F1F1F;
    --border-divider-light: #1A1A1A;
    --border-focus: #D4AF37;
    --border-error: #F87171;
    --border-success: #34D399;
    --border-warning: #FBBF24;
    /* Dark Theme Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-3xl: 0 35px 60px -15px rgba(0, 0, 0, 0.9);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.4);
    --shadow-focus: 0 0 0 3px rgba(212, 175, 55, 0.35);
    --shadow-glow: 0 0 40px rgba(212, 175, 55, 0.25);
    /* Dark Material Elevation Levels */
    --elevation-0: none;
    --elevation-1: 0 2px 1px -1px rgba(0,0,0,0.5), 0 1px 1px 0 rgba(0,0,0,0.35), 0 1px 3px 0 rgba(0,0,0,0.3);
    --elevation-2: 0 3px 1px -2px rgba(0,0,0,0.5), 0 2px 2px 0 rgba(0,0,0,0.35), 0 1px 5px 0 rgba(0,0,0,0.3);
    --elevation-3: 0 3px 3px -2px rgba(0,0,0,0.5), 0 3px 4px 0 rgba(0,0,0,0.35), 0 1px 8px 0 rgba(0,0,0,0.3);
    --elevation-4: 0 2px 4px -1px rgba(0,0,0,0.5), 0 4px 5px 0 rgba(0,0,0,0.35), 0 1px 10px 0 rgba(0,0,0,0.3);
    --elevation-6: 0 3px 5px -1px rgba(0,0,0,0.5), 0 6px 10px 0 rgba(0,0,0,0.35), 0 1px 18px 0 rgba(0,0,0,0.3);
    --elevation-8: 0 5px 5px -3px rgba(0,0,0,0.5), 0 8px 10px 1px rgba(0,0,0,0.35), 0 3px 14px 2px rgba(0,0,0,0.3);
    --elevation-12: 0 7px 8px -4px rgba(0,0,0,0.5), 0 12px 17px 2px rgba(0,0,0,0.35), 0 5px 22px 4px rgba(0,0,0,0.3);
    --elevation-16: 0 8px 10px -5px rgba(0,0,0,0.5), 0 16px 24px 2px rgba(0,0,0,0.35), 0 6px 30px 5px rgba(0,0,0,0.3);
    --elevation-24: 0 11px 15px -7px rgba(0,0,0,0.5), 0 24px 38px 3px rgba(0,0,0,0.35), 0 9px 46px 8px rgba(0,0,0,0.3);
    /* Card Shadows Dark */
    --card-shadow: var(--elevation-2);
    --card-shadow-hover: var(--elevation-8);
    --card-shadow-compact: var(--elevation-1);
    /* Status Indicators Dark */
    --status-online: #34D399;
    --status-stale: #FBBF24;
    --status-offline: #F87171;
    --status-online-bg: #1A3A2A;
    --status-stale-bg: #3D3012;
    --status-offline-bg: #3D1E1E;
    /* Table Colors Dark */
    --table-header-bg: #1A1A1A;
    --table-striped-bg: #161616;
    --table-hover-bg: #1F1F1F;
    --table-border-color: #1F1F1F;
    --table-selected-bg: #3A3419;
    /* Navigation Colors Dark */
    --nav-hover: #1F1F1F;
    --nav-active: #3A3419;
    --nav-selected: #4A4419;
    /* Glass Effect Dark */
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    --glass-blur: 20px;
    /* UI Elements Dark */
    --focus-ring: rgba(212, 175, 55, 0.4);
    --overlay-bg: rgba(0, 0, 0, 0.8);
    /* Scrollbar Dark */
    --scroll-thumb: #3A3A3A;
    --scroll-thumb-hover: #4A4A4A;
    --scroll-track: #1A1A1A;
    /* Surface Variants Dark */
    --surface-variant: #1F1F1F;
    --on-surface-variant: #E5E3E0;
    --outline: #4A4844;
    --outline-variant: #3A3A3A;
}

/* ====== BASE STYLES ====== */
* {
    box-sizing: border-box;
}

    *::before,
    *::after {
        box-sizing: border-box;
    }

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    background-color: var(--body-bg);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: transparent;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Links */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

    a:hover {
        color: var(--text-link-hover);
    }

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-3) 0;
    font-weight: var(--font-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    letter-spacing: var(--letter-spacing-tight);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

/* Paragraphs */
p {
    margin: 0 0 var(--spacing-3) 0;
    line-height: var(--line-height-relaxed);
}

/* Lists */
ul, ol {
    margin: 0 0 var(--spacing-3) 0;
    padding-left: var(--spacing-6);
}

/* Forms */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Code */
code, pre {
    font-family: var(--font-mono);
    background: var(--code-bg);
    border-radius: var(--border-radius-sm);
}

code {
    padding: var(--spacing-0-5) var(--spacing-1);
    font-size: 0.875em;
}

pre {
    padding: var(--spacing-3);
    overflow-x: auto;
    background: var(--pre-bg);
}

/* Selection */
::selection {
    background-color: var(--primary-light);
    color: var(--text-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 5px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--scroll-thumb-hover);
    }

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

/* Focus styles */
:focus-visible {
    outline: var(--focus-width) solid var(--border-focus);
    outline-offset: var(--focus-ring-offset);
}

/* ====== UTILITY CLASSES ====== */

/* Cards with Material Elevation */
.card {
    background: var(--content-bg);
    border: 1px solid var(--border-divider);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    transition: var(--card-transition);
}

    .card:hover {
        transform: var(--hover-lift);
        box-shadow: var(--card-shadow-hover);
    }

/* Material Elevation Classes */
.elevation-0 {
    box-shadow: var(--elevation-0);
}

.elevation-1 {
    box-shadow: var(--elevation-1);
}

.elevation-2 {
    box-shadow: var(--elevation-2);
}

.elevation-3 {
    box-shadow: var(--elevation-3);
}

.elevation-4 {
    box-shadow: var(--elevation-4);
}

.elevation-6 {
    box-shadow: var(--elevation-6);
}

.elevation-8 {
    box-shadow: var(--elevation-8);
}

.elevation-12 {
    box-shadow: var(--elevation-12);
}

.elevation-16 {
    box-shadow: var(--elevation-16);
}

.elevation-24 {
    box-shadow: var(--elevation-24);
}

/* Button Styles - Material Design */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2-5) var(--spacing-5);
    border-radius: var(--border-radius-md);
    font-weight: var(--font-medium);
    font-size: var(--font-size-base);
    line-height: var(--line-height-none);
    transition: var(--hover-transition);
    cursor: pointer;
    border: none;
    outline: none;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    box-shadow: var(--elevation-2);
}

    .btn:hover {
        box-shadow: var(--elevation-4);
    }

    .btn:active {
        transform: var(--pressed-scale);
        box-shadow: var(--elevation-1);
    }

.btn-primary {
    background: var(--primary);
    color: var(--text-on-primary);
}

    .btn-primary:hover {
        background: var(--primary-hover);
    }

.btn-secondary {
    background: var(--secondary);
    color: var(--text-on-secondary);
}

    .btn-secondary:hover {
        background: var(--secondary-hover);
    }

.btn-outlined {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

    .btn-outlined:hover {
        background: var(--hover-bg);
        border-color: var(--primary);
        color: var(--primary);
    }

.btn-text {
    background: transparent;
    color: var(--primary);
    box-shadow: none;
    text-transform: none;
}

button.generate-btn:hover {
    color: black;
}

.generate-btn:hover span.btn-text {
    color: black;
}
/* Form Controls - Material Design */
.form-control {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    background: var(--input-bg);
    border: 1px solid var(--border-divider);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: var(--hover-transition);
}

    .form-control:hover {
        border-color: var(--border-color);
    }

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: var(--shadow-focus);
        background: var(--content-bg);
    }

    .form-control::placeholder {
        color: var(--placeholder-color);
    }

/* Glass Morphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Loading States */
.skeleton {
    background: linear-gradient( 90deg, var(--subtle-bg) 25%, var(--border-divider) 50%, var(--subtle-bg) 75% );
    background-size: 2000px 100%;
    animation: shimmer 2s infinite;
}

/* Ripple Effect for Material Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

    .ripple::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .ripple:active::before {
        width: 300px;
        height: 300px;
    }

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ====== RESPONSIVE UTILITIES ====== */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
}

/* Theme Transition Classes */
html.theme-transitioning {
    background-color: var(--body-bg) !important;
    color: var(--text-primary) !important;
}

    html.theme-transitioning * {
        transition: none !important;
    }

/* Responsive Typography */
@media (max-width: 768px) {
    :root {
        --font-size-base: 0.9375rem;
        --font-size-lg: 1.0625rem;
        --font-size-xl: 1.1875rem;
        --font-size-2xl: 1.375rem;
        --font-size-3xl: 1.75rem;
        --font-size-4xl: 2rem;
        --font-size-5xl: 2.5rem;
        --font-size-6xl: 3rem;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 0.875rem;
        --font-size-lg: 1rem;
        --font-size-xl: 1.125rem;
        --font-size-2xl: 1.25rem;
        --font-size-3xl: 1.5rem;
        --font-size-4xl: 1.875rem;
        --font-size-5xl: 2.25rem;
        --font-size-6xl: 2.75rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none !important;
    }
}

/* Accessibility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary: #D4AF37;
        --text-primary: #000000;
        --content-bg: #ffffff;
        --border-divider: #000000;
    }
}

/* 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;
    }
}

/* Display Utilities */
.d-none {
    display: none !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

.d-grid {
    display: grid !important;
}

/* Flexbox Utilities */
.flex-row {
    flex-direction: row !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.flex-nowrap {
    flex-wrap: nowrap !important;
}

.justify-start {
    justify-content: flex-start !important;
}

.justify-end {
    justify-content: flex-end !important;
}

.justify-center {
    justify-content: center !important;
}

.justify-between {
    justify-content: space-between !important;
}

.justify-around {
    justify-content: space-around !important;
}

.justify-evenly {
    justify-content: space-evenly !important;
}

.align-start {
    align-items: flex-start !important;
}

.align-end {
    align-items: flex-end !important;
}

.align-center {
    align-items: center !important;
}

.align-baseline {
    align-items: baseline !important;
}

.align-stretch {
    align-items: stretch !important;
}

/* Spacing Utilities */
.m-0 {
    margin: 0 !important;
}

.m-1 {
    margin: var(--spacing-1) !important;
}

.m-2 {
    margin: var(--spacing-2) !important;
}

.m-3 {
    margin: var(--spacing-3) !important;
}

.m-4 {
    margin: var(--spacing-4) !important;
}

.m-5 {
    margin: var(--spacing-5) !important;
}

.m-6 {
    margin: var(--spacing-6) !important;
}

.m-8 {
    margin: var(--spacing-8) !important;
}

.m-auto {
    margin: auto !important;
}

.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: var(--spacing-1) !important;
}

.p-2 {
    padding: var(--spacing-2) !important;
}

.p-3 {
    padding: var(--spacing-3) !important;
}

.p-4 {
    padding: var(--spacing-4) !important;
}

.p-5 {
    padding: var(--spacing-5) !important;
}

.p-6 {
    padding: var(--spacing-6) !important;
}

.p-8 {
    padding: var(--spacing-8) !important;
}

/* Text Utilities */
.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-justify {
    text-align: justify !important;
}

.text-primary {
    color: var(--text-primary) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

/* Background Utilities */
.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
}

.bg-success {
    background-color: var(--success) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.bg-warning {
    background-color: var(--warning) !important;
}

.bg-info {
    background-color: var(--info) !important;
}

.bg-white {
    background-color: var(--content-bg) !important;
}

.bg-transparent {
    background-color: transparent !important;
}

/* Border Utilities */
.border {
    border: 1px solid var(--border-divider) !important;
}

.border-0 {
    border: 0 !important;
}

.border-top {
    border-top: 1px solid var(--border-divider) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--border-divider) !important;
}

.border-left {
    border-left: 1px solid var(--border-divider) !important;
}

.border-right {
    border-right: 1px solid var(--border-divider) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.border-secondary {
    border-color: var(--secondary) !important;
}

.border-success {
    border-color: var(--success) !important;
}

.border-danger {
    border-color: var(--danger) !important;
}

.border-warning {
    border-color: var(--warning) !important;
}

.border-info {
    border-color: var(--info) !important;
}

/* Shadow Utilities */
.shadow-none {
    box-shadow: none !important;
}

.shadow-xs {
    box-shadow: var(--shadow-xs) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.shadow-xl {
    box-shadow: var(--shadow-xl) !important;
}

.shadow-2xl {
    box-shadow: var(--shadow-2xl) !important;
}

.shadow-3xl {
    box-shadow: var(--shadow-3xl) !important;
}

.shadow-inner {
    box-shadow: var(--shadow-inner) !important;
}

/* Rounded Utilities */
.rounded-0 {
    border-radius: 0 !important;
}

.rounded-sm {
    border-radius: var(--border-radius-sm) !important;
}

.rounded {
    border-radius: var(--border-radius-md) !important;
}

.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--border-radius-xl) !important;
}

.rounded-2xl {
    border-radius: var(--border-radius-2xl) !important;
}

.rounded-3xl {
    border-radius: var(--border-radius-3xl) !important;
}

.rounded-circle {
    border-radius: var(--border-radius-circle) !important;
}

.rounded-pill {
    border-radius: var(--border-radius-pill) !important;
}

/* Position Utilities */
.position-static {
    position: static !important;
}

.position-relative {
    position: relative !important;
}

.position-absolute {
    position: absolute !important;
}

.position-fixed {
    position: fixed !important;
}

.position-sticky {
    position: sticky !important;
}

/* Overflow Utilities */
.overflow-auto {
    overflow: auto !important;
}

.overflow-hidden {
    overflow: hidden !important;
}

.overflow-visible {
    overflow: visible !important;
}

.overflow-scroll {
    overflow: scroll !important;
}

/* Visibility Utilities */
.visible {
    visibility: visible !important;
}

.invisible {
    visibility: hidden !important;
}

/* Opacity Utilities */
.opacity-0 {
    opacity: 0 !important;
}

.opacity-25 {
    opacity: 0.25 !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.opacity-75 {
    opacity: 0.75 !important;
}

.opacity-100 {
    opacity: 1 !important;
}

/* Z-index Utilities */
.z-0 {
    z-index: 0 !important;
}

.z-10 {
    z-index: 10 !important;
}

.z-20 {
    z-index: 20 !important;
}

.z-30 {
    z-index: 30 !important;
}

.z-40 {
    z-index: 40 !important;
}

.z-50 {
    z-index: 50 !important;
}

.z-auto {
    z-index: auto !important;
}

/* ====== THEME CLASS MANAGEMENT ====== */
html.theme-atriver-light {
    /* Light theme is default, no additional class needed */
}

html.theme-atriver-dark {
    /* Apply dark theme variables via class */
}

/* Smooth theme transition */
html.theme-transition * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ====== LOGO VISIBILITY FIX ====== */
.brand-logo {
    filter: brightness(0) saturate(100%) invert(70%) sepia(61%) saturate(436%) hue-rotate(11deg) brightness(102%) contrast(91%);
}

.theme-atriver-dark .brand-logo {
    filter: brightness(0) saturate(100%) invert(70%) sepia(61%) saturate(436%) hue-rotate(11deg) brightness(102%) contrast(91%);
}
