/* Premium Döner Track - Apple Design System */
/* Designed for CHF 10,000 value */

/* System Fonts & Variables */
:root {
    /* Premium Color Palette */
    --system-blue: #0071e3;
    --system-blue-dark: #0051a2;
    --system-green: #00c853;
    --system-red: #ff3b30;
    --system-orange: #ff9500;
    --system-purple: #af52de;
    --system-pink: #ff2d55;
    --system-indigo: #5856d6;

    /* Sophisticated Gradients */
    --gradient-premium: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-aurora: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-sunset: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-night: linear-gradient(135deg, #30cfd0 0%, #330867 100%);

    /* Spacing System */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Border Radius */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 36px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --shadow-2xl: 0 25px 50px rgba(0,0,0,0.12), 0 12px 24px rgba(0,0,0,0.08);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 20px rgba(102,126,234,0.4);

    /* Animations */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light Theme */
.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #e8e8ed;
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --bg-overlay: rgba(0, 0, 0, 0.4);

    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #c7c7cc;
    --text-inverted: #ffffff;

    --glass-white: rgba(255, 255, 255, 0.72);
    --glass-light: rgba(255, 255, 255, 0.82);
    --glass-ultra-light: rgba(255, 255, 255, 0.92);

    --border-color: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.12);

    --material-blur: blur(40px);
    --material-blur-heavy: blur(80px);
}

/* Dark Theme */
.dark-theme {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-elevated: rgba(28, 28, 30, 0.9);
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --text-tertiary: #636366;
    --text-inverted: #000000;

    --glass-white: rgba(255, 255, 255, 0.08);
    --glass-light: rgba(255, 255, 255, 0.12);
    --glass-ultra-light: rgba(255, 255, 255, 0.16);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);

    --material-blur: blur(40px);
    --material-blur-heavy: blur(80px);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Premium Background Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-premium);
    opacity: 0.05;
    z-index: -1;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); }
    25% { transform: translateX(-5%) translateY(5%) scale(1.1); }
    50% { transform: translateX(5%) translateY(-5%) scale(1.05); }
    75% { transform: translateX(-3%) translateY(-3%) scale(1.08); }
}

/* Floating Particles Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--system-blue);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 20s infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Login Screen - Premium Design */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-premium);
    background-size: 200% 200%;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-card {
    width: 100%;
    max-width: 480px;
    margin: var(--space-lg);
    padding: var(--space-3xl);
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur-heavy);
    -webkit-backdrop-filter: var(--material-blur-heavy);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-2xl);
    transform: translateY(0);
    opacity: 0;
    animation: fadeInUp 0.8s var(--ease-out) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(40px);
    }
}

/* Logo Animation */
.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-xl);
    position: relative;
    animation: logoFloat 3s var(--ease-in-out) infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 20px rgba(0, 113, 227, 0.3));
}

.logo::before,
.logo::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--system-blue) 0%, transparent 70%);
    opacity: 0.1;
    animation: pulse 2s var(--ease-in-out) infinite;
}

.logo::after {
    animation-delay: 1s;
}

@keyframes pulse {
    0%, 100% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.1; }
}

/* Title Typography */
.login-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: var(--space-2xl);
    background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

/* User Selection Grid */
.user-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.user-btn {
    position: relative;
    padding: var(--space-lg) var(--space-md);
    background: var(--glass-white);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    overflow: hidden;
    text-align: center;
    font-weight: 600;
}

.user-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-premium);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.user-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--system-blue);
}

.user-btn:hover::before {
    opacity: 0.1;
}

.user-btn.selected {
    background: var(--system-blue);
    color: white;
    border-color: var(--system-blue);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.3);
}

.user-btn.selected svg {
    color: white;
}

.user-icon {
    display: block;
    margin: 0 auto var(--space-sm);
    color: var(--text-secondary);
    transition: color 0.3s var(--ease-out);
}

/* Password Input */
.password-input {
    width: 100%;
    padding: var(--space-lg);
    background: var(--glass-white);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
    color: var(--text-primary);
    margin-bottom: 20px;
}

.password-input:focus {
    outline: none;
    border-color: var(--system-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    transform: translateY(-2px);
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: var(--space-lg);
    background: var(--system-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.login-btn:hover {
    background: var(--system-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.3);
}

.login-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Main App Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
    opacity: 0;
    animation: fadeIn 0.6s var(--ease-out) forwards;
    animation-delay: 0.2s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Navigation Bar - Premium Glass Design (DESKTOP DEFAULT) */
.navbar {
    position: sticky;
    top: var(--space-lg);
    z-index: 100;
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur-heavy);
    -webkit-backdrop-filter: var(--material-blur-heavy);
    border-radius: var(--radius-xl);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s var(--ease-out);
    flex-wrap: wrap; /* Erlaubt Umbruch der Elemente */
    gap: var(--space-md); /* Abstand zwischen den Hauptsektionen */
}

.navbar:hover {
    box-shadow: var(--shadow-2xl);
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0; /* Verhindert, dass Brand schrumpft */
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-tertiary);
    padding: var(--space-xs);
    border-radius: var(--radius-md);
    flex-wrap: wrap; /* Erlaubt Umbruch der Nav-Items */
    margin-left: auto; /* Push nav-menu to the right, next to user-info */
    margin-right: var(--space-md); /* Space between nav-menu and user-info */
    flex-shrink: 1; /* Erlaubt dem Menü, bei Bedarf zu schrumpfen */
    min-width: 0; /* Ermöglicht Flex-Items, unter den Mindestinhalt zu schrumpfen */
}

.nav-item {
    position: relative;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap; /* Verhindert Zeilenumbruch im Nav-Item Text */
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--glass-white);
}

.nav-item.active {
    color: white;
    background: var(--system-blue);
}

.nav-item.active svg {
    color: white;
}

/* User Info Section */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0; /* Verhindert, dass User-Info schrumpft */
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--glass-white);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    flex-shrink: 0; /* Verhindert Schrumpfung */
}

.theme-toggle:hover {
    background: var(--system-blue);
    border-color: var(--system-blue);
    color: white;
    transform: rotate(180deg);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-premium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    flex-shrink: 0; /* Verhindert Schrumpfung */
}

.user-avatar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.user-avatar:hover::before {
    transform: translateX(100%);
}

.logout-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--system-red);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0; /* Verhindert Schrumpfung */
}

.logout-btn:hover {
    background: #ff1d1d;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 59, 48, 0.3);
}

/* Utility Class to hide text on mobile, show on desktop */
.desktop-only-username {
    display: initial;
}
/* Utility Class to hide text on desktop, show on mobile for specific elements */
.sr-only-mobile {
    display: none; /* Hide by default on desktop */
}

/* Dashboard - Premium Cards */
.dashboard {
    display: none;
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.dashboard.active {
    display: block;
    opacity: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    position: relative;
    padding: var(--space-xl);
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--system-blue) 0%, transparent 70%);
    opacity: 0.05;
    transition: all 0.5s var(--ease-out);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--system-blue);
}

.stat-card:hover::before {
    opacity: 0.1;
    transform: rotate(30deg);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

.stat-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 4px 20px rgba(0, 113, 227, 0.2));
    animation: iconFloat 3s var(--ease-in-out) infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Recent Entries */
.recent-entries {
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.recent-entries h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.recent-entry-item {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s var(--ease-out);
}

.recent-entry-item:last-child {
    border-bottom: none;
}

.recent-entry-item:hover {
    transform: translateX(8px);
    color: var(--system-blue);
}

/* Entry Form - Premium Design */
.entry-form {
    display: none;
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.entry-form.active {
    display: block;
    opacity: 1;
}

.form-card {
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.form-card h2 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-2xl);
    background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-group {
    margin-bottom: var(--space-xl);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-white);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s var(--ease-out);
    color: var(--text-primary);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--system-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    transform: translateY(-2px);
}

/* Radio Group - Premium Style */
.radio-group {
    display: flex;
    gap: var(--space-md);
}

.radio-item {
    flex: 1;
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-item label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--glass-white);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.radio-item label::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-premium);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.radio-item input[type="radio"]:checked + label {
    background: var(--system-blue);
    border-color: var(--system-blue);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.3);
}

.radio-item input[type="radio"]:checked + label::before {
    opacity: 0.2;
}

/* Camera Button - Premium Style */
.camera-btn {
    width: 100%;
    padding: var(--space-2xl);
    background: var(--gradient-premium);
    background-size: 200% 200%;
    animation: gradientMove 10s ease infinite;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.camera-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.camera-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.camera-btn:hover::before {
    transform: translateX(100%);
}

/* Submit Button - Premium Animation */
.submit-btn {
    width: 100%;
    padding: var(--space-lg);
    background: var(--system-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.submit-btn::before,
.submit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.submit-btn::after {
    transition-delay: 0.2s;
}

.submit-btn:hover {
    background: var(--system-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#submitLoader {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

#submitLoader svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* History Section - Premium Design */
.history-section {
    display: none;
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.history-section.active {
    display: block;
    opacity: 1;
}

.history-section h2 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-2xl);
    background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filter-controls {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap; /* Erlaubt Umbruch bei kleinen Bildschirmen */
}

.filter-controls .form-select,
.filter-controls .form-input {
    flex: 1;
    min-width: 200px;
}

/* History Items - Premium Cards */
.history-item {
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--glass-light), transparent);
    transition: left 0.6s;
}

.history-item:hover {
    transform: translateX(8px) scale(1.01);
    box-shadow: var(--shadow-xl);
    border-color: var(--system-blue);
}

.history-item:hover::before {
    left: 100%;
}

.history-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: var(--gradient-premium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s var(--ease-out);
}

.history-item:hover .history-image img {
    transform: scale(1.1);
}

.history-image svg {
    color: white;
    opacity: 0.8;
}

.history-details {
    flex: 1;
}

.history-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.history-meta {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.history-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--system-blue);
    white-space: nowrap;
}

.load-more-btn {
    margin: var(--space-xl) auto;
    padding: var(--space-md) var(--space-2xl);
    background: var(--gradient-premium);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: block;
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.load-more-btn:hover::before {
    transform: scale(1);
}

/* Settings Section - Premium Design */
.settings-section {
    display: none;
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.settings-section.active {
    display: block;
    opacity: 1;
}

.settings-card {
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s var(--ease-out);
}

.settings-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.settings-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.settings-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.theme-selector {
    display: flex;
    gap: var(--space-sm);
    background: var(--bg-tertiary);
    padding: var(--space-xs);
    border-radius: var(--radius-md);
}

.theme-option {
    flex: 1;
    padding: var(--space-md);
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.theme-option:hover {
    background: var(--glass-white);
    color: var(--text-primary);
}

.theme-option.active {
    background: var(--system-blue);
    color: white;
}

/* Checkbox Group - Premium Style */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--glass-white);
    backdrop-filter: var(--material-blur);
    -webkit-backdrop-filter: var(--material-blur);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.checkbox-group:hover {
    border-color: var(--system-blue);
    background: var(--glass-light);
}

.checkbox-group input[type="checkbox"] {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--system-blue);
    border-color: var(--system-blue);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.checkbox-group label {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Loading Overlay - Premium */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-lg);
}

.loading-spinner svg {
    width: 100%;
    height: 100%;
    color: white;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
}

.loading-overlay p {
    color: white;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Success Message - Premium Toast */
.success-message {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    background: var(--glass-ultra-light);
    backdrop-filter: var(--material-blur-heavy);
    -webkit-backdrop-filter: var(--material-blur-heavy);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--system-green);
    padding: var(--space-lg) var(--space-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2xl);
    z-index: 1000;
    animation: slideInRight 0.5s var(--spring);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Error Message - Premium Style */
.error-message {
    color: var(--system-red);
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    margin-top: var(--space-md);
    font-weight: 500;
    animation: shake 0.5s var(--ease-out);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Image Preview - Premium Style */
#imagePreview {
    margin-top: var(--space-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#imagePreview img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

/* Responsive Design - Anpassung für alle Bildschirmgrößen OHNE Hamburger */
@media (max-width: 960px) { /* Anpassung für mittelgroße Bildschirme */
    .navbar {
        padding: var(--space-md);
        gap: var(--space-md); /* Mehr Abstand für Umbruch */
        flex-wrap: wrap; /* Erlaubt Umbruch der Navbar-Elemente */
        justify-content: center; /* Zentriert die Elemente, wenn sie umbrechen */
    }

    .nav-brand {
        margin-right: 0; /* Nicht mehr ganz links gepinnt */
        flex-basis: 100%; /* Brand nimmt volle Breite ein, wenn nötig */
        text-align: center;
        justify-content: center;
    }

    .nav-menu {
        margin-left: 0; /* Kein automatischer linker Rand mehr */
        margin-right: 0; /* Kein automatischer rechter Rand mehr */
        justify-content: center; /* Nav-Items zentrieren */
        flex-basis: 100%; /* Nav-Menü nimmt volle Breite ein */
        padding: var(--space-xs) var(--space-sm);
    }

    .nav-item {
        padding: var(--space-sm); /* Etwas weniger Padding */
        font-size: 15px; /* Etwas kleinere Schrift */
        gap: var(--space-xs); /* Kleinerer Icon-Abstand */
    }

    .user-info {
        flex-basis: 100%; /* User-Info nimmt volle Breite ein */
        justify-content: center; /* User-Info Elemente zentrieren */
        margin-top: var(--space-md); /* Abstand zum Nav-Menü */
    }

    .theme-toggle {
        width: 38px; /* Etwas kleiner */
        height: 38px;
    }

    .user-avatar {
        width: 38px; /* Etwas kleiner */
        height: 38px;
    }
}


@media (max-width: 768px) {
    :root {
        --space-lg: 16px;
        --space-xl: 24px;
        --space-2xl: 32px;
        --space-3xl: 48px;
    }

    .container {
        padding: var(--space-md);
        padding-top: calc(var(--space-md) + 10px); /* Anpassung nach Bedarf, wenn Navbar nicht mehr sticky/fixed ist und umbricht */
    }

    .navbar {
        padding: var(--space-sm);
        gap: var(--space-sm);
        justify-content: space-around; /* Verteilung der Elemente */
        border-radius: var(--radius-lg); /* Etwas kleinere Radius */
        top: var(--space-sm); /* Etwas näher am oberen Rand */
    }

    .nav-brand {
        font-size: 16px;
        flex-basis: auto; /* Brand kann wieder schrumpfen */
        text-align: left; /* Brand linksbündig */
        justify-content: flex-start;
        order: 1; /* Brand zuerst */
        margin-right: auto; /* Push brand to left */
    }

    .nav-menu {
        flex-basis: 100%; /* Nav-Menü nimmt volle Breite ein */
        order: 3; /* Nav-Menü unten */
        margin-top: var(--space-sm); /* Abstand zum User-Info/Brand */
        justify-content: space-around; /* Links gleichmäßig verteilen */
        padding: var(--space-xs);
        gap: var(--space-xs);
    }

    .nav-item {
        padding: var(--space-sm) var(--space-xs); /* Sehr kompaktes Padding */
        font-size: 14px; /* Kleinste Schrift */
        gap: 0; /* Keine Lücke zwischen Icon und Text */
        flex: 1; /* Elemente gleichmäßig verteilen */
        text-align: center;
        flex-direction: column; /* Icon über Text */
        white-space: normal; /* Erlaubt Umbruch, falls Text zu lang */
        min-width: 60px; /* Mindestbreite für Klickfläche */
    }

    .nav-item span {
        font-size: 12px; /* Text noch kleiner machen */
        margin-top: 2px; /* Kleiner Abstand zum Icon */
    }

    .nav-item svg {
        font-size: 20px; /* Kleinere Icons */
    }

    .user-info {
        flex-basis: auto; /* User Info flexibel */
        order: 2; /* User Info in der Mitte */
        margin-top: 0;
        gap: var(--space-sm);
        justify-content: flex-end; /* Elemente rechts ausrichten */
    }

    /* Benutzernamen auf Mobilgeräten ausblenden, um Platz zu sparen */
    .desktop-only-username {
        display: none;
    }

    /* Logout Button auf Mobilgeräten nur Icon anzeigen */
    .logout-btn {
        padding: var(--space-xs); /* Nur Padding für Icon */
        width: 44px; /* Feste Breite und Höhe für Button */
        height: 44px;
        border-radius: var(--radius-full); /* Rund machen */
        justify-content: center; /* Icon zentrieren */
    }

    .logout-btn svg {
        margin: 0; /* Kein extra Margin für Icon */
    }

    .logout-btn .sr-only-mobile {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
        white-space: nowrap; /* keep text on one line */
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: var(--space-xl);
    }

    .login-title {
        font-size: 28px;
        margin-bottom: var(--space-xl);
    }

    .user-selection {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: var(--space-xl);
    }

    .radio-group {
        flex-direction: column;
    }

    .filter-controls {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .history-image {
        width: 100%;
        height: 150px;
        border-radius: var(--radius-sm);
    }

    .history-details {
        width: 100%;
    }

    .history-price {
        align-self: flex-end;
    }

    .success-message {
        top: auto;
        bottom: var(--space-xl);
        right: var(--space-xl);
        left: var(--space-xl);
        width: auto;
    }
}

/* Very small screens (e.g., iPhone 5/SE) */
@media (max-width: 480px) {
    .login-card {
        margin: var(--space-md);
    }
    .login-title {
        font-size: 24px;
    }
    .stat-card {
        padding: var(--space-lg);
    }
    .stat-value {
        font-size: 32px;
    }
    .nav-item {
        padding: var(--space-sm) var(--space-xs); /* Noch kompakter */
        font-size: 13px; /* Minimalste Schrift */
        min-width: 50px; /* Minimalbreite für sehr kleine Bildschirme */
    }
    .nav-item span {
        font-size: 11px;
    }
    .nav-item svg {
        font-size: 18px;
    }
}

/* Focus and selection styles for accessibility and UX */
*:focus {
    outline: 2px solid var(--system-blue);
    outline-offset: 2px;
}

::selection {
    background: var(--system-blue);
    color: white;
}

::-moz-selection {
    background: var(--system-blue);
    color: white;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Performance Optimization */
.stat-card,
.history-item,
.form-card,
.settings-card {
    will-change: transform;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }