/* ═══════════════════════════════════════════════════ */
/* ═══ THEME VARIABLES                             ═══ */
/* ═══════════════════════════════════════════════════ */

:root,
body.theme-orange {
    --color-primary: #ff6b35;
    --color-primary-dark: #e55a2b;
    --color-primary-light: #fff5f0;
    --color-secondary: #f7931e;
    --color-gradient: linear-gradient(135deg, #ff6b35, #f7931e);
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #888888;
    --color-text-muted: #bbbbbb;
    --color-border: #eeeeee;
    --color-shadow: rgba(0,0,0,0.06);
    --color-shadow-strong: rgba(0,0,0,0.15);
    --color-success: #4caf50;
    --color-error: #e53935;
    --color-warning: #f57c00;
    --radius-card: 16px;
    --radius-btn: 12px;
    --radius-pill: 24px;
}

body.theme-dark {
    --color-primary: #bb86fc;
    --color-primary-dark: #9c64e0;
    --color-primary-light: #2d2040;
    --color-secondary: #03dac6;
    --color-gradient: linear-gradient(135deg, #1e1e2e, #2d2040);
    --color-bg: #121212;
    --color-surface: #1e1e2e;
    --color-text: #e0e0e0;
    --color-text-secondary: #aaaaaa;
    --color-text-muted: #666666;
    --color-border: #333333;
    --color-shadow: rgba(0,0,0,0.3);
    --color-shadow-strong: rgba(0,0,0,0.5);
    --color-success: #66bb6a;
    --color-error: #ef5350;
    --color-warning: #ffa726;
}

body.theme-green {
    --color-primary: #2e7d32;
    --color-primary-dark: #1b5e20;
    --color-primary-light: #e8f5e9;
    --color-secondary: #66bb6a;
    --color-gradient: linear-gradient(135deg, #2e7d32, #66bb6a);
    --color-bg: #f1f8f2;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #777777;
    --color-text-muted: #aaaaaa;
    --color-border: #e0e8e0;
    --color-shadow: rgba(0,0,0,0.06);
    --color-shadow-strong: rgba(0,0,0,0.15);
    --color-success: #2e7d32;
    --color-error: #c62828;
    --color-warning: #ef6c00;
}

body.theme-blue {
    --color-primary: #1565c0;
    --color-primary-dark: #0d47a1;
    --color-primary-light: #e3f2fd;
    --color-secondary: #42a5f5;
    --color-gradient: linear-gradient(135deg, #1565c0, #42a5f5);
    --color-bg: #f5f8fc;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #777777;
    --color-text-muted: #aaaaaa;
    --color-border: #e0e8f0;
    --color-shadow: rgba(0,0,0,0.06);
    --color-shadow-strong: rgba(0,0,0,0.15);
    --color-success: #1565c0;
    --color-error: #c62828;
    --color-warning: #e65100;
}

/* ═══════════════════════════════════════════════════ */
/* ═══ BASE RESET & TYPOGRAPHY                     ═══ */
/* ═══════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════ */
/* ═══ ANIMATIONS                                  ═══ */
/* ═══════════════════════════════════════════════════ */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@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); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes checkmark {
    0% { stroke-dashoffset: 50; }
    100% { stroke-dashoffset: 0; }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

/* ═══════════════════════════════════════════════════ */
/* ═══ BLAZOR ERROR UI                             ═══ */
/* ═══════════════════════════════════════════════════ */

#blazor-error-ui {
    color-scheme: light only;
    background: var(--color-primary-light);
    bottom: 0;
    box-shadow: 0 -1px 2px var(--color-shadow);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--color-warning);
}

.blazor-error-boundary {
    background: var(--color-error);
    padding: 1rem;
    color: white;
    text-align: center;
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten.";
}

/* ═══════════════════════════════════════════════════ */
/* ═══ SHARED COMPONENTS                           ═══ */
/* ═══════════════════════════════════════════════════ */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-screen, .error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--color-text-secondary);
    animation: fadeIn 0.4s ease-out;
}

.error-screen h2 {
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-btn);
    background: var(--color-primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--color-shadow-strong);
}

.primary-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--color-shadow-strong);
}

.primary-btn:active {
    transform: translateY(0);
    opacity: 0.85;
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
