/**
 * Verbi - Root CSS
 * CSS Variables, Themes, Typography
 * "Your words. Your German."
 */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES - THEMES
   ============================================ */

/* Theme 1 - Dusk (Default Dark) */
:root,
[data-theme="dusk"] {
    /* Background colors */
    --color-bg: #0D0F1A;
    --color-surface: #151827;
    --color-surface-hover: #1C2035;
    --color-surface-elevated: #1E2237;
    
    /* Brand colors */
    --color-primary: #5B6BFF;
    --color-primary-hover: #6B7BFF;
    --color-primary-muted: rgba(91, 107, 255, 0.15);
    --color-accent: #FF6B6B;
    --color-accent-hover: #FF8585;
    --color-gold: #FFD166;
    --color-gold-muted: rgba(255, 209, 102, 0.15);
    
    /* Text colors */
    --color-text: #F0F2FF;
    --color-text-muted: #7B82A8;
    --color-text-dim: #4A5175;
    
    /* Semantic colors */
    --color-success: #4ADE80;
    --color-success-bg: rgba(74, 222, 128, 0.1);
    --color-error: #FF6B6B;
    --color-error-bg: rgba(255, 107, 107, 0.1);
    --color-warning: #FBBF24;
    --color-info: #60A5FA;
    
    /* Borders */
    --color-border: rgba(123, 130, 168, 0.2);
    --color-border-light: rgba(123, 130, 168, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(91, 107, 255, 0.3);
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #5B6BFF 0%, #8B9BFF 100%);
    --gradient-accent: linear-gradient(135deg, #FF6B6B 0%, #FF9B9B 100%);
    --gradient-gold: linear-gradient(135deg, #FFD166 0%, #FFE599 100%);
    --gradient-bg: linear-gradient(180deg, #0D0F1A 0%, #151827 100%);
    
    /* Glass effect */
    --glass-bg: rgba(21, 24, 39, 0.7);
    --glass-border: rgba(123, 130, 168, 0.2);
}

/* Theme 2 - Alpine (Light) */
[data-theme="alpine"] {
    --color-bg: #F5F7FF;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F0F2FF;
    --color-surface-elevated: #FFFFFF;
    
    --color-primary: #3A4AE8;
    --color-primary-hover: #4A5AF8;
    --color-primary-muted: rgba(58, 74, 232, 0.1);
    --color-accent: #E83A5A;
    --color-accent-hover: #F84A6A;
    --color-gold: #F4A800;
    --color-gold-muted: rgba(244, 168, 0, 0.1);
    
    --color-text: #1A1D2E;
    --color-text-muted: #6B7280;
    --color-text-dim: #9CA3AF;
    
    --color-border: rgba(107, 114, 128, 0.15);
    --color-border-light: rgba(107, 114, 128, 0.08);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(58, 74, 232, 0.2);
    
    --gradient-primary: linear-gradient(135deg, #3A4AE8 0%, #5A6AF8 100%);
    --gradient-accent: linear-gradient(135deg, #E83A5A 0%, #F85A7A 100%);
    --gradient-gold: linear-gradient(135deg, #F4A800 0%, #FFB800 100%);
    --gradient-bg: linear-gradient(180deg, #F5F7FF 0%, #FFFFFF 100%);
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(107, 114, 128, 0.2);
}

/* Theme 3 - Forest (Nature Dark) */
[data-theme="forest"] {
    --color-bg: #0E1A14;
    --color-surface: #162210;
    --color-surface-hover: #1C2A15;
    --color-surface-elevated: #1E2C17;
    
    --color-primary: #4ADE80;
    --color-primary-hover: #5AEE90;
    --color-primary-muted: rgba(74, 222, 128, 0.15);
    --color-accent: #FACC15;
    --color-accent-hover: #FFDC25;
    --color-gold: #FB923C;
    --color-gold-muted: rgba(251, 146, 60, 0.15);
    
    --color-text: #ECFDF5;
    --color-text-muted: #6EE7B7;
    --color-text-dim: #4ADE80;
    
    --color-success: #4ADE80;
    --color-success-bg: rgba(74, 222, 128, 0.1);
    --color-error: #FB923C;
    --color-error-bg: rgba(251, 146, 60, 0.1);
    
    --color-border: rgba(110, 231, 183, 0.15);
    --color-border-light: rgba(110, 231, 183, 0.08);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(74, 222, 128, 0.25);
    
    --gradient-primary: linear-gradient(135deg, #4ADE80 0%, #7AEEA0 100%);
    --gradient-accent: linear-gradient(135deg, #FACC15 0%, #FFDC35 100%);
    --gradient-gold: linear-gradient(135deg, #FB923C 0%, #FFAB5C 100%);
    --gradient-bg: linear-gradient(180deg, #0E1A14 0%, #162210 100%);
    
    --glass-bg: rgba(22, 34, 16, 0.7);
    --glass-border: rgba(110, 231, 183, 0.2);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

:root {
    /* Font families */
    --font-display: 'Syne', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-german: 'Playfair Display', Georgia, serif;
    
    /* Font sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-7xl: 4.5rem;
    
    /* Font weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
    
    /* Letter spacing */
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    
    /* ============================================
       SPACING (8px base grid)
       ============================================ */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */
    
    /* ============================================
       LAYOUT
       ============================================ */
    --max-width: 1280px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 64px;
    --header-height: 64px;
    
    /* ============================================
       BORDERS & RADII
       ============================================ */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* ============================================
       TRANSITIONS
       ============================================ */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-dim);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Selection */
::selection {
    background: var(--color-primary);
    color: white;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Links */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

/* Paragraphs */
p {
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Lists */
ul, ol {
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
}

/* Code */
code, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

code {
    background: var(--color-surface);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

pre {
    background: var(--color-surface);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
}

/* Form elements base */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* Utility 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: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.text-gold { color: var(--color-gold); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }

.font-display { font-family: var(--font-display); }
.font-german { font-family: var(--font-german); }
.font-mono { font-family: var(--font-mono); }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}