/* ═══════════════════════════════════════════════════════════════
   BASE.CSS - kontovergleich.at
   Variables, Reset, Typography, Utilities
   Mobile-First Approach | WCAG 2.1 AA Compliant
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────
   CSS Variables - Accessibility Optimized
   ─────────────────────────────────────────────────────────────── */
:root {
    /* Primary Colors */
    --primary: #1a1f20;
    --primary-light: #5a6366;
    --secondary: #ffffff;
    
    /* Accent Colors - Contrast Checked */
    --accent: #00a67d;
    --accent-dark: #008c6a;
    --accent-light: #e6f7f3;
    --accent-on-dark: #4ade9f;
    
    /* Text Colors for Accessibility */
    --text-on-accent: #003d30;
    --text-on-dark: #f0f4f3;
    --text-muted-on-dark: #a8b5b2;
    
    /* Background Colors */
    --bg-light: #f5f7f6;
    --bg-dark: #1a1f20;
    --bg-card: #ffffff;
    
    /* Border & Dividers */
    --border: #d8dedd;
    --border-light: #e8eceb;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-accent: 0 4px 16px rgba(0,166,125,0.2);
    
    /* Border Radius */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 100px;
    
    /* Transitions */
    --transition: all 0.2s ease;
    --transition-fast: all 0.15s ease;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Badge Colors - High Contrast */
    --badge-success-bg: #d1fae5;
    --badge-success-text: #065f46;
    --badge-warning-bg: #fef3c7;
    --badge-warning-text: #92400e;
    --badge-error-bg: #fee2e2;
    --badge-error-text: #991b1b;
    --badge-info-bg: #e0f2fe;
    --badge-info-text: #075985;
    --badge-neutral-bg: #f3f4f6;
    --badge-neutral-text: #374151;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* ───────────────────────────────────────────────────────────────
   Typography - Mobile First
   ─────────────────────────────────────────────────────────────── */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

@media (min-width: 768px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    h4 { font-size: 1.125rem; }
}

p {
    margin-bottom: var(--space-md);
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ───────────────────────────────────────────────────────────────
   Container - Mobile First
   ─────────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

.container-sm { max-width: 900px; }
.container-xs { max-width: 700px; }

/* ───────────────────────────────────────────────────────────────
   Utility Classes
   ─────────────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--primary-light); }
.text-accent { color: var(--accent); }
.text-success { color: var(--badge-success-text); }
.text-error { color: var(--badge-error-text); }

.font-mono { font-family: 'Space Mono', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.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); }

.py-1 { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-2 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-3 { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }

.px-1 { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-2 { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-3 { padding-left: var(--space-lg); padding-right: var(--space-lg); }

/* ───────────────────────────────────────────────────────────────
   Buttons - Accessible & Mobile-Friendly (44px min touch target)
   ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    min-height: 44px;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: var(--shadow-accent);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border);
}

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

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ───────────────────────────────────────────────────────────────
   Tags & Badges - High Contrast (WCAG AA)
   ─────────────────────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.25rem 0.625rem;
    background: var(--badge-neutral-bg);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--badge-neutral-text);
    white-space: nowrap;
}

.tag-success,
.tag-accent {
    background: var(--badge-success-bg);
    color: var(--badge-success-text);
}

.tag-warning {
    background: var(--badge-warning-bg);
    color: var(--badge-warning-text);
}

.tag-error {
    background: var(--badge-error-bg);
    color: var(--badge-error-text);
}

.tag-info {
    background: var(--badge-info-bg);
    color: var(--badge-info-text);
}

/* Badge on dark backgrounds - proper contrast */
.tag-on-dark {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-on-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-on-dark.success {
    background: rgba(74, 222, 159, 0.2);
    color: var(--accent-on-dark);
    border-color: rgba(74, 222, 159, 0.3);
}

/* ───────────────────────────────────────────────────────────────
   Cards - Base
   ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    transition: var(--transition);
}

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

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ───────────────────────────────────────────────────────────────
   Lists
   ─────────────────────────────────────────────────────────────── */
.list-none {
    list-style: none;
}

.list-check li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: var(--space-sm);
}

.list-check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ───────────────────────────────────────────────────────────────
   Animations
   ─────────────────────────────────────────────────────────────── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slideUp {
    animation: slideUp 0.4s ease forwards;
}

.animate-stagger > * {
    opacity: 0;
    animation: slideUp 0.4s ease forwards;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ───────────────────────────────────────────────────────────────
   Accessibility
   ─────────────────────────────────────────────────────────────── */
.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;
}

::selection {
    background: var(--accent);
    color: white;
}

::-moz-selection {
    background: var(--accent);
    color: white;
}
