/* ============================================
   Modern Inventory Manager 2025 - Main Styles
   Professional, Clean, and Intuitive Design
   Optimized for Desktop, iPad Pro M4 13", iPhone (Touch-Ready)
   ============================================ */

/* ==================== Body Modal State ==================== */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Alternative body scroll lock via inline style */
body[style*="overflow: hidden"] {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* ==================== Large Recipe Modal Layout ==================== */
@media (min-width: 992px) {
  #recipeModal .modal-content.modal-lg {
    width: 96vw;
    max-width: 1600px;
    /* Make box slightly larger than content but avoid huge empty space */
    height: auto;
    min-height: 72vh;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  /* Generic large modal helper: apply to any modal using this class */
  .modal-content.modal-lg.process-details-large {
    width: 96vw;
    max-width: 1600px;
    /* auto height to reduce empty space, but keep strong presence */
    height: auto;
    min-height: 72vh;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  #recipeModal .modal-body,
  #processDetailsModal .modal-body,
  #processModal .modal-body,
  #mischenModal .modal-body {
    flex: 1 1 auto;
    overflow: auto;
  }
  .recipe-edit-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.85fr; /* left info/stats, right ingredients */
    gap: 1.25rem;
    align-items: start;
  }
  .recipe-edit-left > .form-section,
  .recipe-edit-right > .form-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
  }
  .recipe-edit-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
  }

  /* Two-column list for process ingredients on large screens */
  #processDetailsModal .ingredients-tracking #ingredientsTrackingList {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 0.75rem;
  }
  #processDetailsModal .ingredient-tracking-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    background: var(--card-bg);
  }

  /* Match colorful card design for left info/stats like ingredient items */
  #processDetailsModal .recipe-edit-left {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertically center on large screens */
    gap: 1rem;
  }
  #processDetailsModal .modal-body {
    display: flex; /* allow child grid to stretch vertically */
  }
  #processDetailsModal .recipe-edit-grid {
    flex: 1 1 auto;
    align-items: stretch;
  }
  /* Info cards: fully transparent per request */
  #processDetailsModal .process-summary > * {
    background: transparent;
    border: 0;
    border-left: 0;
    border-radius: 0;
    padding: 0.25rem 0;
  }
  #processDetailsModal .summary-stats .summary-value,
  #processDetailsModal .summary-totals .total-value,
  #processDetailsModal .summary-amounts .amount-value {
    color: var(--primary);
    font-weight: 700;
  }
  #processDetailsModal #scalingInfoContainer > * {
    background: transparent;
    border: 0;
    border-left: 0;
    border-radius: 0;
    padding: 0.25rem 0;
  }

  /* Recipe modal: vertically center left column and apply glassy cards */
  #recipeModal .recipe-edit-left {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertically center */
    gap: 1rem;
  }
  #recipeModal .recipe-edit-grid { align-items: stretch; }
  /* Right column remains glassy cards */
  #recipeModal .recipe-edit-right .form-section {
    backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-color);
  }
  /* Left info side fully transparent */
  #recipeModal .recipe-edit-left .form-section {
    background: transparent;
    border: 0;
    border-left: 0;
    box-shadow: none;
  }
  /* Center right column content as well */
  #recipeModal .recipe-edit-right,
  #processDetailsModal .recipe-edit-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
  }
}

/* ==================== CSS Variables ==================== */
:root {
    /* iOS 26 Glassmorphism Settings - Einstellbar */
    --glass-blur: 12px;
    --glass-saturation: 180%;
    --glass-opacity: 0.15;  /* Light theme default */

    /* Colors - Modern 2025 Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-color: #6366f1;
    --secondary: #8b5cf6;
    --secondary-color: #8b5cf6;
    --success: #10b981;
    --success-color: #10b981;
    --danger: #ef4444;
    --error-color: #ef4444;
    --warning: #f59e0b;
    --warning-color: #f59e0b;
    --info: #3b82f6;
    --info-color: #3b82f6;

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --info-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --error-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Neutral Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-color: #e5e7eb;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Touch Target Sizes */
    --touch-target-min: 44px;

    /* Animated Gradient Background Colors - Light Pastel Mode */
    --color-bg1: rgb(240, 249, 255);
    --color-bg2: rgb(243, 244, 246);
    --color1: 191, 219, 254;
    --color2: 221, 214, 254;
    --color3: 167, 243, 208;
    --color4: 253, 224, 71;
    --color5: 252, 165, 165;
    --color6: 251, 207, 232;
    --color7: 153, 246, 228;
    --color8: 253, 186, 116;
    --color9: 196, 181, 253;
    --color10: 165, 243, 252;
    --color-interactive: 199, 210, 254;
    --circle-size: 80%;
    --blending: hard-light;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --card-bg: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border: #374151;
    --border-color: #374151;

    /* Dark Mode Gradient Background */
    --color-bg1: rgb(17, 24, 39);
    --color-bg2: rgb(31, 41, 55);
    --color1: 59, 130, 246;
    --color2: 139, 92, 246;
    --color3: 16, 185, 129;
    --color4: 245, 158, 11;
    --color5: 239, 68, 68;
    --color6: 236, 72, 153;
    --color7: 20, 184, 166;
    --color8: 251, 146, 60;
    --color9: 168, 85, 247;
    --color10: 52, 211, 153;
    --color-interactive: 99, 102, 241;
}

/* Rainbow/Party Mode */
[data-theme="rainbow"] {
    --bg-primary: #1a0b2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #b0b0b0;
    --border: rgba(255, 255, 255, 0.15);
    --border-color: rgba(255, 255, 255, 0.15);

    /* Rainbow specific colors - Lila→Türkis Gradient */
    --rainbow-1: #8b5cf6;  /* Violett 500 */
    --rainbow-2: #a78bfa;  /* Violett 400 */
    --rainbow-3: #c084fc;  /* Violett 300 */
    --rainbow-4: #06b6d4;  /* Cyan 500 */
    --rainbow-5: #22d3ee;  /* Cyan 400 */
    --rainbow-6: #67e8f9;  /* Cyan 300 */

    /* Rainbow Mode Gradient Background - Vibrant! */
    --color-bg1: rgb(139, 92, 246);
    --color-bg2: rgb(6, 182, 212);
    --color1: 236, 72, 153;
    --color2: 167, 139, 250;
    --color3: 34, 211, 238;
    --color4: 251, 191, 36;
    --color5: 244, 63, 94;
    --color6: 168, 85, 247;
    --color7: 20, 184, 166;
    --color8: 249, 115, 22;
    --color9: 192, 132, 252;
    --color10: 103, 232, 249;
    --color-interactive: 217, 70, 239;
}

/* ==================== Animated Gradients ==================== */

/* Rainbow mode - Vibrant cycling gradient */
[data-theme="rainbow"] body {
    background: linear-gradient(135deg,
        var(--bg-primary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    animation: rainbowBodyGradient 7.5s ease infinite;
    background-size: 400% 400%;
}

[data-theme="rainbow"] .card,
[data-theme="rainbow"] .ingredient-card,
[data-theme="rainbow"] .recipe-card,
[data-theme="rainbow"] .product-card,
[data-theme="rainbow"] .process-card,
[data-theme="rainbow"] .machine-card,
[data-theme="rainbow"] .timer-card,
[data-theme="rainbow"] .modal-content {
    position: relative;
    overflow: hidden;
}

[data-theme="rainbow"] .card::before,
[data-theme="rainbow"] .ingredient-card::before,
[data-theme="rainbow"] .recipe-card::before,
[data-theme="rainbow"] .process-card::before,
[data-theme="rainbow"] .machine-card::before,
[data-theme="rainbow"] .timer-card::before,
[data-theme="rainbow"] .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(167, 139, 250, 0.15) 25%,
        rgba(6, 182, 212, 0.15) 75%,
        rgba(34, 211, 238, 0.15) 100%
    );
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}

/* Product cards don't use rainbow gradient - they use extracted color */

[data-theme="rainbow"] .card > *,
[data-theme="rainbow"] .ingredient-card > *,
[data-theme="rainbow"] .recipe-card > *,
[data-theme="rainbow"] .product-card > *,
[data-theme="rainbow"] .process-card > *,
[data-theme="rainbow"] .machine-card > *,
[data-theme="rainbow"] .timer-card > *,
[data-theme="rainbow"] .modal-content > * {
    position: relative;
    z-index: 1;
}

/* Light mode - Subtle animated gradient */
[data-theme="light"] body {
    background: linear-gradient(135deg,
        #f0f9ff 0%,
        #e0f2fe 25%,
        #f5f3ff 50%,
        #fdf4ff 75%,
        #fef3c7 100%
    );
    background-size: 300% 300%;
    animation: lightBodyGradient 10s ease infinite;
}

[data-theme="light"] .card,
[data-theme="light"] .ingredient-card,
[data-theme="light"] .recipe-card,
[data-theme="light"] .product-card,
[data-theme="light"] .process-card,
[data-theme="light"] .machine-card,
[data-theme="light"] .timer-card {
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .card > *,
[data-theme="light"] .ingredient-card > *,
[data-theme="light"] .recipe-card > *,
[data-theme="light"] .product-card > *,
[data-theme="light"] .process-card > *,
[data-theme="light"] .machine-card > *,
[data-theme="light"] .timer-card > * {
    position: relative;
    z-index: 1;
}

[data-theme="light"] .card::before,
[data-theme="light"] .ingredient-card::before,
[data-theme="light"] .recipe-card::before,
[data-theme="light"] .process-card::before,
[data-theme="light"] .machine-card::before,
[data-theme="light"] .timer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.05) 0%,
        rgba(139, 92, 246, 0.05) 50%,
        rgba(251, 146, 60, 0.05) 100%
    );
    background-size: 200% 200%;
    animation: lightCardGradient 7.5s ease infinite;
    z-index: 0;
    pointer-events: none;
}

/* Product cards don't use theme gradient - they use extracted color */

/* Dark mode - Sleek animated gradient */
[data-theme="dark"] body {
    background: linear-gradient(135deg,
        #0f172a 0%,
        #1e1b4b 25%,
        #1f2937 50%,
        #164e63 75%,
        #14532d 100%
    );
    background-size: 300% 300%;
    animation: darkBodyGradient 10s ease infinite;
}

[data-theme="dark"] .card,
[data-theme="dark"] .ingredient-card,
[data-theme="dark"] .recipe-card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .process-card,
[data-theme="dark"] .machine-card,
[data-theme="dark"] .timer-card {
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .card > *,
[data-theme="dark"] .ingredient-card > *,
[data-theme="dark"] .recipe-card > *,
[data-theme="dark"] .product-card > *,
[data-theme="dark"] .process-card > *,
[data-theme="dark"] .machine-card > *,
[data-theme="dark"] .timer-card > * {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .card::before,
[data-theme="dark"] .ingredient-card::before,
[data-theme="dark"] .recipe-card::before,
[data-theme="dark"] .process-card::before,
[data-theme="dark"] .machine-card::before,
[data-theme="dark"] .timer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(99, 102, 241, 0.1) 0%,
        rgba(139, 92, 246, 0.1) 50%,
        rgba(6, 182, 212, 0.1) 100%
    );
    background-size: 200% 200%;
    animation: darkCardGradient 7.5s ease infinite;
    z-index: 0;
    pointer-events: none;
}

/* Product cards don't use theme gradient - they use extracted color */

/* ==================== Gradient Keyframes ==================== */

@keyframes rainbowBodyGradient {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 50% 100%;
    }
    50% {
        background-position: 100% 50%;
    }
    75% {
        background-position: 50% 0%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rainbowCardGradient {
    0% {
        background-position: 0% 50%;
    }
    33% {
        background-position: 100% 50%;
    }
    66% {
        background-position: 50% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes lightBodyGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes lightCardGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes darkBodyGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes darkCardGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Rainbow mode - Transparent/Frosted Buttons (kein Gradient) */
[data-theme="rainbow"] .btn,
[data-theme="rainbow"] .btn-primary,
[data-theme="rainbow"] button:not(.btn-icon) {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
}

[data-theme="rainbow"] .btn:hover,
[data-theme="rainbow"] .btn-primary:hover,
[data-theme="rainbow"] button:not(.btn-icon):hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="rainbow"] .btn-secondary,
[data-theme="rainbow"] .filter-select,
[data-theme="rainbow"] select {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: var(--text-primary) !important;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
}

[data-theme="rainbow"] .btn-secondary:hover,
[data-theme="rainbow"] .filter-select:hover,
[data-theme="rainbow"] select:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="rainbow"] .btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
}

[data-theme="rainbow"] .btn:hover,
[data-theme="rainbow"] .btn-primary:hover,
[data-theme="rainbow"] .btn-secondary:hover,
[data-theme="rainbow"] button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6), 0 4px 15px rgba(34, 211, 238, 0.4) !important;
}

@keyframes rainbowButton {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

/* Rainbow text for all important elements - Lila→Türkis Gradient (statisch) */
[data-theme="rainbow"] .page-title,
[data-theme="rainbow"] .page-subtitle,
[data-theme="rainbow"] h1,
[data-theme="rainbow"] h2,
[data-theme="rainbow"] h3,
[data-theme="rainbow"] h4,
[data-theme="rainbow"] .card-title,
[data-theme="rainbow"] .ingredient-name,
[data-theme="rainbow"] .recipe-name,
[data-theme="rainbow"] .product-name,
[data-theme="rainbow"] .process-name,
[data-theme="rainbow"] .machine-name,
[data-theme="rainbow"] label,
[data-theme="rainbow"] .form-section-title,
[data-theme="rainbow"] .modal-header h2,
[data-theme="rainbow"] .stats-value,
[data-theme="rainbow"] .timer-display {
    color: white !important;
    text-shadow:
        0 0 10px rgba(139, 92, 246, 0.6),
        0 0 20px rgba(167, 139, 250, 0.4),
        0 0 30px rgba(6, 182, 212, 0.3),
        0 0 40px rgba(34, 211, 238, 0.2) !important;
}

/* Rainbow theme - Nav-Brand und aktive Links mit stärkerem Glow */
[data-theme="rainbow"] .nav-brand {
    text-shadow:
        0 0 15px rgba(139, 92, 246, 0.6),
        0 0 25px rgba(167, 139, 250, 0.4),
        0 0 35px rgba(6, 182, 212, 0.3) !important;
}

[data-theme="rainbow"] .nav-link.active {
    text-shadow:
        0 0 12px rgba(139, 92, 246, 0.5),
        0 0 22px rgba(167, 139, 250, 0.3),
        0 0 32px rgba(6, 182, 212, 0.2) !important;
}

/* Light theme - Subtiler Glow für wichtige Texte */
[data-theme="light"] .nav-brand {
    text-shadow:
        0 0 8px rgba(99, 102, 241, 0.2),
        0 0 16px rgba(99, 102, 241, 0.1) !important;
}

[data-theme="light"] .nav-link.active {
    text-shadow:
        0 0 6px rgba(99, 102, 241, 0.25),
        0 0 12px rgba(99, 102, 241, 0.15) !important;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] .card-title,
[data-theme="light"] .ingredient-name,
[data-theme="light"] .recipe-name,
[data-theme="light"] .product-name,
[data-theme="light"] .process-name,
[data-theme="light"] .machine-name,
[data-theme="light"] .form-section-title,
[data-theme="light"] .modal-header h2,
[data-theme="light"] .stats-value {
    text-shadow:
        0 0 8px rgba(99, 102, 241, 0.15),
        0 0 16px rgba(99, 102, 241, 0.1);
}

/* Dark theme - Stärkerer Glow für wichtige Texte */
[data-theme="dark"] .nav-brand {
    text-shadow:
        0 0 12px rgba(99, 102, 241, 0.4),
        0 0 22px rgba(99, 102, 241, 0.3) !important;
}

[data-theme="dark"] .nav-link.active {
    text-shadow:
        0 0 10px rgba(99, 102, 241, 0.45),
        0 0 18px rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] .card-title,
[data-theme="dark"] .ingredient-name,
[data-theme="dark"] .recipe-name,
[data-theme="dark"] .product-name,
[data-theme="dark"] .process-name,
[data-theme="dark"] .machine-name,
[data-theme="dark"] .form-section-title,
[data-theme="dark"] .modal-header h2,
[data-theme="dark"] .stats-value {
    text-shadow:
        0 0 10px rgba(99, 102, 241, 0.4),
        0 0 20px rgba(99, 102, 241, 0.3),
        0 0 30px rgba(99, 102, 241, 0.2);
}

@keyframes rainbowText {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* ==================== iOS-Style Glassmorphismus ==================== */

/* Glassmorphismus für alle wichtigen Elemente */
.navbar,
/* ==================== iOS 26 Glassmorphism für ALLE Cardboards & Boxen ==================== */
.card,
.ingredient-card,
.recipe-card,
.product-card,
.process-card,
.machine-card,
.timer-card,
.stats-card,
.stat-card,
.status-card,
.setting-card,
.feature-card,
.quick-access-card,
.thc-overview-card,
.process-chain-card,
.process-type-card,
.process-type-card-compact,
.modal-content,
.filter-bar,
.page-header,
.timer-bubble,
.timer-bubble-item,
.machine-status-section,
.machine-control-section,
.machine-settings-section,
.status-item,
.ws-connection-status,
.ws-status-content,
.info-box,
.detail-box,
.meta-box,
.btn-secondary,
.tag-toggle-btn,
.timer-card,
.stopwatch-card {
    backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%)) !important;
}

/* Light Mode Glassmorphismus - Timer-Style für alle */
[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* UNIFIED iOS 26 Glass Design - Light Theme */
[data-theme="light"] .card,
[data-theme="light"] .ingredient-card,
[data-theme="light"] .recipe-card,
[data-theme="light"] .process-card,
[data-theme="light"] .machine-card,
[data-theme="light"] .timer-card,
[data-theme="light"] .stats-card,
[data-theme="light"] .stat-card,
[data-theme="light"] .status-card,
[data-theme="light"] .setting-card,
[data-theme="light"] .feature-card,
[data-theme="light"] .quick-access-card,
[data-theme="light"] .thc-overview-card,
[data-theme="light"] .process-chain-card,
[data-theme="light"] .process-type-card,
[data-theme="light"] .process-type-card-compact,
[data-theme="light"] .info-box,
[data-theme="light"] .detail-box,
[data-theme="light"] .meta-box,
[data-theme="light"] .timer-bubble-item,
[data-theme="light"] .machine-status-section,
[data-theme="light"] .machine-control-section,
[data-theme="light"] .machine-settings-section,
[data-theme="light"] .status-item,
[data-theme="light"] .ws-connection-status,
[data-theme="light"] .ws-status-content,
[data-theme="light"] .btn-secondary,
[data-theme="light"] .tag-toggle-btn,
[data-theme="light"] .timer-card,
[data-theme="light"] .stopwatch-card {
    background: rgba(255, 255, 255, var(--glass-opacity, 0.15)) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

/* Product cards use extracted color, not theme background */
[data-theme="light"] .product-card {
    background: rgba(255, 255, 255, var(--glass-opacity, 0.15)) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .filter-bar,
[data-theme="light"] .page-header {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* Dark Mode Glassmorphismus - Timer-Style für alle */
[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* UNIFIED iOS 26 Glass Design - Dark Theme */
[data-theme="dark"] .card,
[data-theme="dark"] .ingredient-card,
[data-theme="dark"] .recipe-card,
[data-theme="dark"] .process-card,
[data-theme="dark"] .machine-card,
[data-theme="dark"] .timer-card,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .status-card,
[data-theme="dark"] .setting-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .quick-access-card,
[data-theme="dark"] .thc-overview-card,
[data-theme="dark"] .process-chain-card,
[data-theme="dark"] .process-type-card,
[data-theme="dark"] .process-type-card-compact,
[data-theme="dark"] .info-box,
[data-theme="dark"] .detail-box,
[data-theme="dark"] .meta-box,
[data-theme="dark"] .timer-bubble-item,
[data-theme="dark"] .machine-status-section,
[data-theme="dark"] .machine-control-section,
[data-theme="dark"] .machine-settings-section,
[data-theme="dark"] .status-item,
[data-theme="dark"] .ws-connection-status,
[data-theme="dark"] .ws-status-content,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .tag-toggle-btn,
[data-theme="dark"] .timer-card,
[data-theme="dark"] .stopwatch-card {
    background: rgba(31, 41, 55, var(--glass-opacity, 0.6)) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

/* Product cards use extracted color, not theme background */
[data-theme="dark"] .product-card {
    background: rgba(31, 41, 55, var(--glass-opacity, 0.6)) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="dark"] .modal-content {
    background: rgba(31, 41, 55, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .filter-bar,
[data-theme="dark"] .page-header {
    background: rgba(31, 41, 55, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Rainbow Mode Glassmorphismus - Timer-Style für alle */
[data-theme="rainbow"] .navbar {
    background: rgba(26, 11, 46, 0.25) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(139, 92, 246, 0.4);
}

/* UNIFIED iOS 26 Glass Design - Rainbow Theme */
[data-theme="rainbow"] .card,
[data-theme="rainbow"] .ingredient-card,
[data-theme="rainbow"] .recipe-card,
[data-theme="rainbow"] .process-card,
[data-theme="rainbow"] .machine-card,
[data-theme="rainbow"] .timer-card,
[data-theme="rainbow"] .stats-card,
[data-theme="rainbow"] .stat-card,
[data-theme="rainbow"] .status-card,
[data-theme="rainbow"] .setting-card,
[data-theme="rainbow"] .feature-card,
[data-theme="rainbow"] .quick-access-card,
[data-theme="rainbow"] .thc-overview-card,
[data-theme="rainbow"] .process-chain-card,
[data-theme="rainbow"] .process-type-card,
[data-theme="rainbow"] .process-type-card-compact,
[data-theme="rainbow"] .info-box,
[data-theme="rainbow"] .detail-box,
[data-theme="rainbow"] .meta-box,
[data-theme="rainbow"] .timer-bubble-item,
[data-theme="rainbow"] .machine-status-section,
[data-theme="rainbow"] .machine-control-section,
[data-theme="rainbow"] .machine-settings-section,
[data-theme="rainbow"] .status-item,
[data-theme="rainbow"] .ws-connection-status,
[data-theme="rainbow"] .ws-status-content,
[data-theme="rainbow"] .btn-secondary,
[data-theme="rainbow"] .tag-toggle-btn,
[data-theme="rainbow"] .timer-card,
[data-theme="rainbow"] .stopwatch-card {
    background: rgba(22, 33, 62, var(--glass-opacity, 0.5)) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

/* Product cards use extracted color, not theme background */
[data-theme="rainbow"] .product-card {
    background: rgba(22, 33, 62, var(--glass-opacity, 0.5)) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="rainbow"] .modal-content {
    background: rgba(22, 33, 62, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

[data-theme="rainbow"] .filter-bar,
[data-theme="rainbow"] .page-header {
    background: rgba(22, 33, 62, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 8px 32px 0 rgba(139, 92, 246, 0.3);
}

/* Inputs und Selects mit Glassmorphismus - Transparent und frosted */
[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: rgba(255, 255, 255, 0.3) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    background: rgba(255, 255, 255, 0.5) !important;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: rgba(55, 65, 81, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    background: rgba(55, 65, 81, 0.5) !important;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

[data-theme="rainbow"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="rainbow"] select:not(.filter-select),
[data-theme="rainbow"] textarea {
    background: rgba(55, 65, 81, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
    color: white;
    transition: all 0.3s ease;
}

[data-theme="rainbow"] input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="rainbow"] select:not(.filter-select):focus,
[data-theme="rainbow"] textarea:focus {
    background: rgba(55, 65, 81, 0.4) !important;
    border-color: #a78bfa;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

/* Timer Bubble mit Glassmorphismus - Einheitlich transparent/frosted */
.timer-bubble {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(150%) !important;
}

[data-theme="dark"] .timer-bubble {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="rainbow"] .timer-bubble {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ==================== Favoriten Highlighting ==================== */

/* Light Mode Favoriten - keep base color, add gold overlay */
[data-theme="light"] .ingredient-card.favorite,
[data-theme="light"] .recipe-card.favorite,
[data-theme="light"] .product-card.favorite,
[data-theme="light"] .process-card.favorite,
[data-theme="light"] .machine-card.favorite {
    border: 2px solid rgba(255, 215, 0, 0.6) !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4),
                0 8px 32px 0 rgba(31, 38, 135, 0.2) !important;
    position: relative;
}

/* Favorite gold gradient overlay - on top of color */
.product-card.favorite::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.15) 0%,
        rgba(255, 183, 77, 0.15) 50%,
        rgba(255, 152, 0, 0.15) 100%
    );
    background-size: 200% 200%;
    animation: favoriteGradient 3s ease infinite;
    pointer-events: none;
    z-index: 2;
}

[data-theme="light"] .ingredient-card.favorite::before,
[data-theme="light"] .recipe-card.favorite::before,
[data-theme="light"] .process-card.favorite::before,
[data-theme="light"] .machine-card.favorite::before {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.2) 0%,
        rgba(255, 183, 77, 0.2) 50%,
        rgba(255, 152, 0, 0.2) 100%
    ) !important;
    background-size: 200% 200% !important;
    animation: favoriteGradient 3s ease infinite !important;
}

/* Dark Mode Favoriten - keep base color, add gold overlay */
[data-theme="dark"] .ingredient-card.favorite,
[data-theme="dark"] .recipe-card.favorite,
[data-theme="dark"] .product-card.favorite,
[data-theme="dark"] .process-card.favorite,
[data-theme="dark"] .machine-card.favorite {
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3),
                0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
}

.product-card.favorite::before {
    z-index: 2;
}

[data-theme="dark"] .ingredient-card.favorite::before,
[data-theme="dark"] .recipe-card.favorite::before,
[data-theme="dark"] .process-card.favorite::before,
[data-theme="dark"] .machine-card.favorite::before {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.2) 0%,
        rgba(255, 183, 77, 0.2) 50%,
        rgba(255, 152, 0, 0.2) 100%
    ) !important;
    background-size: 200% 200% !important;
    animation: favoriteGradient 3s ease infinite !important;
}

/* Rainbow Mode Favoriten - keep base color, add gold overlay */
[data-theme="rainbow"] .ingredient-card.favorite,
[data-theme="rainbow"] .recipe-card.favorite,
[data-theme="rainbow"] .product-card.favorite,
[data-theme="rainbow"] .process-card.favorite,
[data-theme="rainbow"] .machine-card.favorite {
    border: 2px solid rgba(255, 215, 0, 0.7) !important;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6),
                0 8px 32px 0 rgba(255, 215, 0, 0.4) !important;
}

[data-theme="rainbow"] .ingredient-card.favorite::before,
[data-theme="rainbow"] .recipe-card.favorite::before,
[data-theme="rainbow"] .process-card.favorite::before,
[data-theme="rainbow"] .machine-card.favorite::before {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.25) 0%,
        rgba(255, 183, 77, 0.25) 25%,
        rgba(255, 152, 0, 0.25) 50%,
        rgba(255, 193, 7, 0.25) 75%,
        rgba(255, 215, 0, 0.25) 100%
    ) !important;
    background-size: 300% 300% !important;
    animation: favoriteRainbowGradient 2s ease infinite !important;
}

/* Favoriten Animation */
@keyframes favoriteGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes favoriteRainbowGradient {
    0% {
        background-position: 0% 50%;
        filter: brightness(1);
    }
    50% {
        background-position: 100% 50%;
        filter: brightness(1.2);
    }
    100% {
        background-position: 0% 50%;
        filter: brightness(1);
    }
}

/* Favoriten Stern Icon Pulsieren */
.ingredient-card.favorite .favorite-btn i,
.recipe-card.favorite .favorite-btn i,
.product-card.favorite .favorite-btn i,
.process-card.favorite .favorite-btn i,
.machine-card.favorite .favorite-btn i {
    animation: favoritePulse 2s ease-in-out infinite;
    color: #ffd700 !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

@keyframes favoritePulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1));
    }
}

/* ==================== Wavy Background Animations ==================== */

/* ==================== Gradient Blob Animations ==================== */

@keyframes moveInCircle {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes moveVertical {
    0% {
        transform: translateY(-50%);
    }
    50% {
        transform: translateY(50%);
    }
    100% {
        transform: translateY(-50%);
    }
}

@keyframes moveHorizontal {
    0% {
        transform: translateX(-50%) translateY(-10%);
    }
    50% {
        transform: translateX(50%) translateY(10%);
    }
    100% {
        transform: translateX(-50%) translateY(-10%);
    }
}

/* Bubble bounce animations - verschiedene Richtungen mit Abprallen */

@keyframes bubbleBounce1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(150px, -100px) scale(1.1);
    }
    50% {
        transform: translate(100px, 80px) scale(0.9);
    }
    75% {
        transform: translate(-80px, -50px) scale(1.05);
    }
}

@keyframes bubbleBounce2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(-120px, 60px) scale(0.95);
    }
    50% {
        transform: translate(-200px, -40px) scale(1.08);
    }
    75% {
        transform: translate(-80px, 90px) scale(1.02);
    }
}

@keyframes bubbleBounce3 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    33% {
        transform: translate(0, -150px) rotate(120deg) scale(1.15);
    }
    66% {
        transform: translate(0, 100px) rotate(240deg) scale(0.85);
    }
}

@keyframes bubbleBounce4 {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(-100px, -100px);
    }
    50% {
        transform: translate(-150px, 50px);
    }
    75% {
        transform: translate(-50px, 120px);
    }
}

@keyframes bubbleBounce5 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    20% {
        transform: translate(120px, 80px) scale(1.1) rotate(72deg);
    }
    40% {
        transform: translate(80px, -60px) scale(0.9) rotate(144deg);
    }
    60% {
        transform: translate(-90px, -100px) scale(1.05) rotate(216deg);
    }
    80% {
        transform: translate(-60px, 70px) scale(0.95) rotate(288deg);
    }
}

@keyframes bubbleBounce6 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(180px, 0) scale(1.12);
    }
}

@keyframes bubbleBounce7 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, -100px) rotate(90deg);
    }
    50% {
        transform: translate(0, -150px) rotate(180deg);
    }
    75% {
        transform: translate(-100px, -100px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@keyframes bubbleBounce8 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-50px, 120px) scale(0.9);
    }
    66% {
        transform: translate(70px, -80px) scale(1.1);
    }
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    background: transparent;
    /* iOS Overscroll-Verhinderung */
    overscroll-behavior: none;
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--font-sans);
    background: transparent; /* Transparent damit Gradient durchscheint */
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* iOS Overscroll-Verhinderung */
    overscroll-behavior: none;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100vw;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* ==================== Animated Wavy Background with Bubbles ==================== */

/* ==================== Animated Gradient Background ==================== */

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: linear-gradient(40deg, var(--color-bg1), var(--color-bg2));
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.gradient-bg svg {
    position: absolute;
    top: 0;
    left: 0;
}

.gradients-container {
    filter: blur(16px);
    width: 100%;
    height: 100%;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
}

/* Gradient Blob Base Styles */
.g1, .g2, .g3, .g4, .g5, .g6, .g7, .g8, .g9, .g10, .interactive {
    position: absolute;
    mix-blend-mode: var(--blending);
    opacity: 1;
}

/* Gradient 1 - Vertical Movement */
.g1 {
    background: radial-gradient(circle at center, rgba(var(--color1), 0.8) 0, rgba(var(--color1), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2);
    left: calc(50% - var(--circle-size) / 2);
    transform-origin: center center;
    animation: moveVertical 30s ease infinite;
}

/* Gradient 2 - Circular Movement (Reverse) */
.g2 {
    background: radial-gradient(circle at center, rgba(var(--color2), 0.8) 0, rgba(var(--color2), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2);
    left: calc(50% - var(--circle-size) / 2);
    transform-origin: calc(50% - 400px);
    animation: moveInCircle 20s reverse infinite;
}

/* Gradient 3 - Large Circular Movement */
.g3 {
    background: radial-gradient(circle at center, rgba(var(--color3), 0.8) 0, rgba(var(--color3), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2 + 200px);
    left: calc(50% - var(--circle-size) / 2 - 500px);
    transform-origin: calc(50% + 400px);
    animation: moveInCircle 40s linear infinite;
}

/* Gradient 4 - Horizontal Movement */
.g4 {
    background: radial-gradient(circle at center, rgba(var(--color4), 0.8) 0, rgba(var(--color4), 0) 50%) no-repeat;
    width: var(--circle-size);
    height: var(--circle-size);
    top: calc(50% - var(--circle-size) / 2);
    left: calc(50% - var(--circle-size) / 2);
    transform-origin: calc(50% - 200px);
    animation: moveHorizontal 40s ease infinite;
    opacity: 0.7;
}

/* Gradient 5 - Large Circular Movement */
.g5 {
    background: radial-gradient(circle at center, rgba(var(--color5), 0.8) 0, rgba(var(--color5), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 2);
    height: calc(var(--circle-size) * 2);
    top: calc(50% - var(--circle-size));
    left: calc(50% - var(--circle-size));
    transform-origin: calc(50% - 800px) calc(50% + 200px);
    animation: moveInCircle 20s ease infinite;
}

/* Gradient 6 - Diagonal Movement */
.g6 {
    background: radial-gradient(circle at center, rgba(var(--color6), 0.8) 0, rgba(var(--color6), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 0.8);
    height: calc(var(--circle-size) * 0.8);
    top: calc(50% - var(--circle-size) / 2 + 100px);
    left: calc(50% - var(--circle-size) / 2 + 300px);
    transform-origin: calc(50% + 200px);
    animation: moveInCircle 25s ease infinite;
}

/* Gradient 7 - Fast Circular */
.g7 {
    background: radial-gradient(circle at center, rgba(var(--color7), 0.8) 0, rgba(var(--color7), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 0.9);
    height: calc(var(--circle-size) * 0.9);
    top: calc(50% - var(--circle-size) / 2 - 150px);
    left: calc(50% - var(--circle-size) / 2 + 200px);
    transform-origin: calc(50% - 250px);
    animation: moveInCircle 15s reverse infinite;
}

/* Gradient 8 - Horizontal Slide */
.g8 {
    background: radial-gradient(circle at center, rgba(var(--color8), 0.8) 0, rgba(var(--color8), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 1.3);
    height: calc(var(--circle-size) * 1.3);
    top: calc(50% - var(--circle-size) / 2 - 200px);
    left: calc(50% - var(--circle-size) / 2 - 400px);
    transform-origin: center;
    animation: moveHorizontal 35s ease infinite;
}

/* Gradient 9 - Slow Vertical */
.g9 {
    background: radial-gradient(circle at center, rgba(var(--color9), 0.8) 0, rgba(var(--color9), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 1.1);
    height: calc(var(--circle-size) * 1.1);
    top: calc(50% - var(--circle-size) / 2 + 300px);
    left: calc(50% - var(--circle-size) / 2 + 100px);
    transform-origin: center;
    animation: moveVertical 38s ease-in-out infinite;
}

/* Gradient 10 - Circular Wide */
.g10 {
    background: radial-gradient(circle at center, rgba(var(--color10), 0.8) 0, rgba(var(--color10), 0) 50%) no-repeat;
    width: calc(var(--circle-size) * 0.75);
    height: calc(var(--circle-size) * 0.75);
    top: calc(50% - var(--circle-size) / 2 - 100px);
    left: calc(50% - var(--circle-size) / 2 - 200px);
    transform-origin: calc(50% + 300px);
    animation: moveInCircle 28s linear infinite;
}

/* Interactive Gradient - Follows Mouse (Responsive Size) */
.interactive {
    background: radial-gradient(circle at center, rgba(var(--color-interactive), 0.8) 0, rgba(var(--color-interactive), 0) 50%) no-repeat;
    width: 100%;
    height: 100%;
    top: -50%;
    left: -50%;
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive Touch Ball for iPad */
@media (max-width: 1024px) {
    .interactive {
        width: 70%;
        height: 70%;
        top: -35%;
        left: -35%;
    }
}

/* Responsive Touch Ball for iPhone */
@media (max-width: 768px) {
    .interactive {
        width: 60%;
        height: 60%;
        top: -30%;
        left: -30%;
    }
}

/* Floating bubbles with bounce (Optimiert: 6 Bubbles) */
.bubble {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--bubble-light), var(--bubble-dark));
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    box-shadow:
        inset 0 0 30px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3);
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Bubble 1 - Top left */
.bubble:nth-child(2) {
    width: 100px;
    height: 100px;
    left: 15%;
    top: 20%;
    animation: bubbleBounce1 18s ease-in-out infinite;
}

/* Bubble 2 - Top right */
.bubble:nth-child(3) {
    width: 70px;
    height: 70px;
    left: 75%;
    top: 15%;
    animation: bubbleBounce2 22s ease-in-out infinite;
}

/* Bubble 3 - Middle left */
.bubble:nth-child(4) {
    width: 120px;
    height: 120px;
    left: 8%;
    top: 50%;
    animation: bubbleBounce3 25s ease-in-out infinite;
}

/* Bubble 4 - Middle right */
.bubble:nth-child(5) {
    width: 80px;
    height: 80px;
    left: 80%;
    top: 45%;
    animation: bubbleBounce4 20s ease-in-out infinite;
}

/* Bubble 5 - Bottom left */
.bubble:nth-child(6) {
    width: 90px;
    height: 90px;
    left: 25%;
    top: 70%;
    animation: bubbleBounce5 23s ease-in-out infinite;
}

/* Bubble 6 - Bottom right */
.bubble:nth-child(7) {
    width: 60px;
    height: 60px;
    left: 65%;
    top: 75%;
    animation: bubbleBounce6 19s ease-in-out infinite;
}

/* ==================== Reduced Motion Support (Accessibility & Performance) ==================== */
@media (prefers-reduced-motion: reduce) {
    .gradient-bg,
    .gradients-container,
    .g1, .g2, .g3, .g4,
    .bubble,
    .interactive {
        animation: none !important;
        transition: none !important;
    }

    /* Statische Positionen für Blobs bei reduced-motion */
    .g1, .g2, .g3, .g4 {
        transform: none !important;
    }

    /* Bubbles ausblenden bei reduced-motion */
    .bubble {
        display: none;
    }

    /* Body-Gradient statisch */
    [data-theme="light"] body,
    [data-theme="dark"] body,
    [data-theme="rainbow"] body {
        animation: none !important;
        background-size: 100% 100% !important;
    }

    /* Card-Animationen deaktivieren */
    .card::before,
    .ingredient-card::before,
    .recipe-card::before,
    .process-card::before,
    .machine-card::before,
    .timer-card::before {
        animation: none !important;
    }
}

/* iOS Safari Performance-Optimierung */
@supports (-webkit-touch-callout: none) {
    .gradients-container {
        filter: blur(12px);
    }

    .bubble {
        box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.4);
    }
}

/* Light theme colors - Harmonisches Blau-Schema */
[data-theme="light"] {
    --wave-color-1: rgba(191, 219, 254, 0.3);  /* Hellstes Blau - hinten */
    --wave-color-2: rgba(96, 165, 250, 0.35);   /* Mittleres Blau - mitte */
    --wave-color-3: rgba(37, 99, 235, 0.4);     /* Dunkelstes Blau - vorne */
    --bubble-light: rgba(147, 197, 253, 0.95);  /* Hellblau - höhere Sättigung */
    --bubble-dark: rgba(59, 130, 246, 0.9);     /* Kräftiges Blau - höhere Sättigung */
}

/* Dark theme colors - Harmonisches Grau-Lila-Schema */
[data-theme="dark"] {
    --wave-color-1: rgba(75, 85, 99, 0.25);     /* Hellstes Grau - hinten */
    --wave-color-2: rgba(55, 65, 81, 0.35);     /* Mittleres Grau - mitte */
    --wave-color-3: rgba(31, 41, 55, 0.45);     /* Dunkelstes Grau - vorne */
    --bubble-light: rgba(196, 181, 253, 0.85);  /* Helles Lila - höhere Sättigung */
    --bubble-dark: rgba(139, 92, 246, 0.9);     /* Kräftiges Violett - höhere Sättigung */
}

/* Rainbow theme colors - Lila→Türkis Verlauf */
[data-theme="rainbow"] {
    --wave-color-1: rgba(139, 92, 246, 0.3);    /* Violett - hinten */
    --wave-color-2: rgba(167, 139, 250, 0.35);  /* Helles Violett - mitte */
    --wave-color-3: rgba(34, 211, 238, 0.4);    /* Cyan - vorne */
    --bubble-light: rgba(192, 132, 252, 0.95);  /* Helles Violett */
    --bubble-dark: rgba(34, 211, 238, 0.95);    /* Kräftiges Cyan */
}

a, button, input, select, textarea {
    touch-action: manipulation;
}

/* ==================== Glassmorphism Settings Slider ==================== */
.glass-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--primary) 100%);
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.glass-slider:hover {
    opacity: 1;
}

.glass-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.glass-slider::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.glass-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    border: none;
}

.glass-slider::-moz-range-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

/* ==================== Navigation ==================== */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* iOS Safe Area Support - auch seitlich */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.nav-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.95rem; /* 5% kleiner */
    font-size: 1.1875rem; /* 5% kleiner: 1.25 * 0.95 */
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    min-height: 41.8px; /* 5% kleiner: 44 * 0.95 */
    padding: var(--spacing-xs) 0;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.15);
}

.nav-brand i {
    font-size: 1.425rem; /* 5% kleiner: 1.5 * 0.95 */
}

/* Brand text container - default: single line */
.nav-brand-text {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-brand-line1,
.nav-brand-line2 {
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 0.25rem; /* Hälfte von 0.5rem */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    min-height: 44px; /* Touch-optimiert */
    min-width: 44px;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    touch-action: manipulation;
}

.nav-link:active {
    transform: scale(0.95);
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.3),
        0 0 16px rgba(255, 255, 255, 0.15);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    font-family: var(--font-sans);
    min-height: var(--touch-target-min);
    min-width: 44px;
    user-select: none;
    position: relative;
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    z-index: 1;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    touch-action: manipulation;
}

.btn > * {
    position: relative;
    z-index: 2;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    transition: var(--transition-fast);
}

.btn:hover::before {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-primary::before {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.btn-secondary::before {
    background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
    opacity: 0.4;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover::before {
    opacity: 0.6;
}

.btn-danger {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-danger::before {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.btn-danger:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.btn-danger:active {
    transform: scale(0.97);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.1rem;
    min-height: 56px;
}

.btn-icon {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.15rem;
    position: relative;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    touch-action: manipulation;
}

.btn-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    padding: 1.5px;
    background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    transition: var(--transition-fast);
}

.btn-icon:hover::before {
    opacity: 0.5;
}

.btn-icon:active {
    transform: scale(0.92);
    background: rgba(99, 102, 241, 0.15);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-logout {
    color: var(--text-secondary);
    margin-left: 1rem; /* Extra Abstand zum Theme-Button */
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-logout:active {
    transform: scale(0.9);
    background: rgba(239, 68, 68, 0.15);
}

/* ==================== Main Content ==================== */
.main-content {
    max-width: 95%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    min-height: calc(100vh - 70px);
    /* Padding für Fixed Navbar - ca. 70px Navbar-Höhe + Safe Area */
    margin-top: calc(70px + env(safe-area-inset-top));
    padding-bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
    padding-left: calc(var(--spacing-lg) + env(safe-area-inset-left));
    padding-right: calc(var(--spacing-lg) + env(safe-area-inset-right));
    position: relative;
    z-index: 10;
}

/* ==================== Hero Section ==================== */
.hero-section {
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-bottom: var(--spacing-xl);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
}

.gradient-text {
    text-shadow:
        0 0 10px rgba(99, 102, 241, 0.6),
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 30px rgba(99, 102, 241, 0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

/* ==================== Statistics Cards ==================== */
/* Note: Main stat-card styles are defined later in the file for better organization */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

/* ==================== Features Section ==================== */
.features-section {
    margin-top: var(--spacing-2xl);
}

.section-title {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:active {
    transform: scale(0.98);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== PWA Settings ==================== */
.pwa-settings-section {
    margin-top: var(--spacing-2xl);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.setting-card {
    background: var(--bg-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    gap: var(--spacing-lg);
    transition: var(--transition);
}

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

.setting-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.setting-content {
    flex: 1;
}

.setting-content h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.setting-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* ==================== Page Header ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-top: var(--spacing-sm);
}

/* Page Header Actions - Button container */
.page-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==================== Filter Bar ==================== */
.filter-bar {
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 2.8rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--bg-secondary);
    color: var(--text-primary);
    min-height: var(--touch-target-min);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
}

.filter-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-select {
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: var(--touch-target-min);
    min-width: 120px;
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    position: relative;
}

.filter-select::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: var(--transition-fast);
    pointer-events: none;
}

.filter-select:hover::before {
    opacity: 0.6;
}

.filter-select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

.filter-select:focus::before {
    opacity: 0.8;
}

/* ==================== Ingredients Grid ==================== */
.ingredients-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 336px), 1fr));
    gap: var(--spacing-lg);
}

/* Larger cards for recipes to fit long ingredient names on one line */
#recipesContainer {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}

.ingredient-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}

.ingredient-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Clickable cards - Process, Ingredient, Recipe */
.ingredient-card[data-process-id],
.ingredient-card[data-ingredient-id],
.ingredient-card[data-recipe-id] {
    position: relative;
}

/* Card hover effects */

.ingredient-card[data-process-id]:hover {
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.25);
    border: 1px solid var(--primary-color);
}

.ingredient-card[data-ingredient-id]:hover {
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ingredient-card[data-recipe-id]:hover {
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.ingredient-card.inactive {
    opacity: 0.6;
}

.ingredient-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.ingredient-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
}

.ingredient-header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.ingredient-status-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.ingredient-header-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.ingredient-header-actions .btn-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.95rem;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    position: relative;
    z-index: 1;
}

.ingredient-header-actions .btn-icon > * {
    position: relative;
    z-index: 2;
}

.ingredient-header-actions .btn-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.2;
    transition: var(--transition-fast);
}

.ingredient-header-actions .btn-icon:hover::before {
    opacity: 0.4;
}

.ingredient-header-actions .btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.05);
}

.ingredient-header-actions .favorite-btn:hover {
    background: rgba(245, 158, 11, 0.15);
}

.ingredient-header-actions .favorite-btn:hover::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.8), rgba(251, 191, 36, 0.8));
    opacity: 0.6;
}

.ingredient-status-row .edit-btn {
    background: rgba(99, 102, 241, 0.08);
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--primary);
    font-size: 0.95rem;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    position: relative;
    z-index: 1;
}

.ingredient-status-row .edit-btn > * {
    position: relative;
    z-index: 2;
}

.ingredient-status-row .edit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: var(--transition-fast);
}

.ingredient-status-row .edit-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.ingredient-status-row .edit-btn:hover::before {
    opacity: 0.7;
}

.ingredient-header-actions .quick-start-btn {
    background: rgba(16, 185, 129, 0.08);
}

.ingredient-header-actions .quick-start-btn::before {
    background: linear-gradient(135deg, var(--success), #10b981);
    opacity: 0.4;
}

.ingredient-header-actions .quick-start-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.ingredient-header-actions .quick-start-btn:hover::before {
    opacity: 0.7;
}

.ingredient-status-row .status-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    position: relative;
    z-index: 1;
}

.ingredient-status-row .status-btn > * {
    position: relative;
    z-index: 2;
}

.ingredient-status-row .status-btn.active {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
}

.ingredient-status-row .status-btn.active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, var(--success), #10b981);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: var(--transition-fast);
}

.ingredient-status-row .status-btn.active:hover {
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: scale(1.05);
}

.ingredient-status-row .status-btn.active:hover::before {
    opacity: 0.7;
}

.ingredient-status-row .status-btn.inactive {
    background: rgba(107, 114, 128, 0.08);
    color: var(--text-tertiary);
}

.ingredient-status-row .status-btn.inactive::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.2;
    transition: var(--transition-fast);
}

.ingredient-status-row .status-btn.inactive:hover {
    background: rgba(107, 114, 128, 0.15);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.2);
    transform: scale(1.05);
}

.ingredient-status-row .status-btn.inactive:hover::before {
    opacity: 0.4;
}

.ingredient-body {
    padding: var(--spacing-lg);
}

.ingredient-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.info-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.info-row i {
    width: 24px;
    color: var(--primary);
    font-size: 1.1rem;
}

.info-label {
    font-weight: 500;
    min-width: 100px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

.ingredient-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    /* Glasmorphism Effect */
    background: rgba(99, 102, 241, 0.12);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 32px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* Dark Theme Tags */
[data-theme="dark"] .tag {
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .tag:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Rainbow Theme Tags */
[data-theme="rainbow"] .tag {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

[data-theme="rainbow"] .tag:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.ingredient-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    border-top: 1px solid var(--border);
    padding-top: var(--spacing-md);
}

.action-btn {
    flex: 1 1 auto;
    min-width: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.875rem;
    min-height: var(--touch-target-min);
    user-select: none;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn-edit {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-btn-edit:hover {
    background: var(--primary);
    color: white;
}

.action-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.action-btn-delete:hover {
    background: var(--danger);
    color: white;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-lg);
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

/* ==================== Modal ==================== */
.modal {
    display: none; /* WICHTIG: Standardmäßig versteckt */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center; /* Zentriert */
    justify-content: center;
    padding: var(--spacing-md);
    overflow-y: auto;
    overflow-x: hidden;
}

.modal.active {
    display: flex; /* Nur wenn aktiv */
}

.modal#recipeModal,
.modal#processDetailsModal,
.modal#processModal,
.modal#mischenModal {
    /* Force white typography within modals for better contrast on glass */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.35);
    --border-color: rgba(255, 255, 255, 0.35);
    /* Darker glass card background to support white text */
    --card-bg: rgba(17, 24, 39, 0.35);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden; /* Changed: Don't scroll the entire modal, only modal-body */
    animation: modalSlideIn 0.3s ease-out;
    /* Zentriert */
    align-self: center;
    margin: 1rem;
    z-index: 2001;
    display: flex;
    flex-direction: column;
}

/* Ingredient Selection Modal - bleibt oben */
#ingredientSelectModal {
    align-items: flex-start;
}

#ingredientSelectModal .modal-content {
    align-self: flex-start;
    margin-top: calc(env(safe-area-inset-top) + 1rem);
    margin-bottom: 1rem;
}

/* Timer/Stopuhr Modals - 1/4 von oben */
#addTimerModal,
#addStopwatchModal {
    align-items: flex-start;
}

#addTimerModal .modal-content,
#addStopwatchModal .modal-content {
    align-self: flex-start;
    margin-top: 25vh;
    margin-bottom: 1rem;
}

/* Timer/Stopuhr Modals - Kreuz-Button verstecken */
#addTimerModal .modal-header .btn-close,
#addStopwatchModal .modal-header .btn-close,
#addTimerModal .modal-header .btn-icon,
#addStopwatchModal .modal-header .btn-icon {
    display: none !important;
}

/* iPad und Tablet - Breitere Modals */
@media (min-width: 768px) {
    .modal-content {
        max-width: 800px;
    }
}

/* Desktop - Noch breitere Modals */
@media (min-width: 1024px) {
    .modal-content {
        max-width: 900px;
    }
}

/* Landscape-Modus: Modal scrollbar und kompakter */
@media (max-height: 500px) {
    .modal-content {
        max-height: 85vh;
        margin-top: calc(env(safe-area-inset-top) + 0.5rem);
        overflow-y: auto !important;
    }

    .modal-header,
    .modal-footer {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .modal-body {
        padding: var(--spacing-md);
        max-height: none;
        overflow-y: visible;
    }
}

/* iPad Landscape spezifisch - Größere Bildschirme im Querformat */
@media (min-width: 768px) and (max-height: 600px) and (orientation: landscape) {
    .modal-content {
        max-width: 85vw;
        max-height: 90vh;
        overflow-y: auto !important;
        margin-top: calc(env(safe-area-inset-top) + 0.5rem);
    }

    .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto !important;
    }
}

.modal-sm {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.modal-body {
    padding: var(--spacing-xl);
    padding-bottom: calc(var(--spacing-xl) + 1rem); /* Extra space above buttons */
    flex: 1 1 auto;
    min-height: 0; /* Important: allows flex child to shrink and scroll */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: var(--spacing-xl);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    font-size: 1rem;
}

.required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: var(--transition-fast);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    min-height: var(--touch-target-min);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
}

.tags-input-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    min-height: 40px;
}

.tag-input {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    min-height: 36px;
}

/* Available Tags Bubbles */
.available-tags-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.25rem;
}

.available-tag-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.available-tag-bubble:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.available-tag-bubble:active {
    transform: translateY(0);
}

.available-tag-bubble.used {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

.available-tag-bubble.used:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
    transform: none;
    box-shadow: none;
}

.available-tag-bubble i {
    font-size: 0.75rem;
}

.tag-input button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.tag-input button:active {
    transform: scale(0.9);
}

.tag-input button:hover {
    background: var(--danger);
    color: white;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: var(--spacing-lg);
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-sm) 0;
    min-height: var(--touch-target-min);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    background: var(--bg-secondary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.85rem;
}

.checkbox-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 500;
    font-size: 1rem;
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    top: 90px;
    right: var(--spacing-lg);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 320px;
    min-height: 60px;
    pointer-events: all;
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-info {
    border-left: 4px solid var(--info);
}

/* ==================== Confirm Dialog (Custom Modal) ==================== */
.confirm-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    isolation: isolate;
}

.confirm-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

.confirm-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card-bg) !important;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    max-width: 500px;
    width: calc(100% - 2rem);
    z-index: 999999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    will-change: transform, opacity;
    pointer-events: auto !important;
}

.confirm-dialog.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

.confirm-dialog:focus {
    outline: none;
}

.confirm-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirm-title i {
    color: var(--primary);
    font-size: 1.375rem;
}

.confirm-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.confirm-message {
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

.confirm-actions {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Tablet optimizations for confirm dialog */
@media (min-width: 429px) and (max-width: 1024px) {
    .confirm-dialog {
        max-width: 600px !important;
        width: calc(100% - 3rem) !important;
    }

    .confirm-actions .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
}

/* iPhone optimizations for confirm dialog */
@media (max-width: 428px) {
    .confirm-dialog {
        width: calc(100% - 1rem) !important;
        max-width: none !important;
        border-radius: var(--radius-md) !important;
    }

    .confirm-header,
    .confirm-content,
    .confirm-actions {
        padding: 1rem !important;
    }

    .confirm-title {
        font-size: 1.125rem !important;
    }

    .confirm-title i {
        font-size: 1.25rem !important;
    }

    .confirm-message {
        font-size: 0.9375rem !important;
    }

    .confirm-actions {
        flex-direction: column-reverse !important;
        gap: 0.75rem !important;
    }

    .confirm-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px !important;
        font-size: 1rem !important;
    }
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2500;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

/* ==================== iPhone-specific optimizations ==================== */
@media (max-width: 428px) {
    /* Kompaktere Formulare auf iPhone */
    .form-control {
        padding: 10px 12px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .form-section {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .tags-display {
        max-height: 150px;
        overflow-y: auto;
    }
    
    input[type="number"] {
        -moz-appearance: textfield;
    }
    
    input[type="number"]::-webkit-inner-spin-button,
    input[type="number"]::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    
    .modal-lg {
        max-width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .page-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .page-header button {
        width: 100%;
    }
}

/* ==================== Responsive Design ==================== */

/* iPad specific - More cards per row */
@media (min-width: 768px) and (max-width: 1366px) {
    .ingredients-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }

    #recipesContainer {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
    }

    /* Reduced padding for wider usable area */
    .page-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .inventory-page,
    .recipes-page,
    .processes-page {
        padding: 0 var(--spacing-sm);
    }

    /* Wider page header */
    .page-header {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    /* Wider filter bar */
    .filter-bar {
        padding: 0 var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    /* Prevent horizontal scroll on all pages */
    * {
        max-width: 100vw;
        box-sizing: border-box;
    }

    .page-header,
    .filter-bar,
    .stats-grid,
    .ingredients-container,
    .inventory-page {
        width: 100%;
        overflow-x: hidden;
    }
    
    .nav-container {
        padding: 0 var(--spacing-md);
        min-height: 60px;
    }
    
    .nav-brand {
        font-size: 0.95rem; /* 5% kleiner: 1.0 * 0.95 */
        gap: 0.475rem; /* 5% kleiner: 0.5 * 0.95 */
        min-height: 39.71px; /* 5% kleiner für mobile */
    }

    .nav-brand i {
        font-size: 1.14rem; /* 5% kleiner: 1.2 * 0.95 */
    }

    /* Two-line layout for mobile */
    .nav-brand-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        line-height: 1.1;
    }

    .nav-brand-line1 {
        font-size: 0.9rem; /* 5% kleiner: 0.95 * 0.95 */
        font-weight: 700;
    }

    .nav-brand-line2 {
        font-size: 0.8rem; /* 5% kleiner: 0.85 * 0.94 */
        font-weight: 600;
        opacity: 0.8;
    }
    
    .nav-links {
        gap: 0.11875rem; /* Hälfte von 0.2375rem */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        flex: 1;
        margin: 0 0.475rem; /* 5% kleiner: 0.5 * 0.95 */
    }

    .nav-links::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        min-width: 44px;
        min-height: 44px; /* Touch-optimiert */
        flex-shrink: 0;
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    }

    .nav-link span {
        display: none;
    }

    .nav-link i {
        font-size: 1.235rem; /* 5% kleiner: 1.3 * 0.95 */
    }
    
    .main-content {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .hero-section {
        padding: var(--spacing-lg) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
    }
    
    .filter-select {
        flex: 1;
        width: 100%;
    }
    
    .modal {
        padding: var(--spacing-sm);
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        max-height: 90vh;
        max-width: 95vw;
        width: 95vw;
        border-radius: var(--radius-xl);
        animation: modalZoomIn 0.3s ease-out;
        transform: scale(0.8);
        transform-origin: center;
    }

    /* Fixed X button on mobile for Dragieren/Trocknen modals */
    #dragierenModal .modal-header,
    #trocknenModal .modal-header {
        position: sticky;
        top: 0;
        background: var(--bg-primary);
        z-index: 100;
        margin: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    #dragierenModal .modal-header .btn-icon,
    #trocknenModal .modal-header .btn-icon {
        position: fixed;
        top: calc(5vh + 0.5rem);
        right: calc(2.5vw + 0.5rem);
        z-index: 101;
        background: var(--bg-primary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        border: 2px solid var(--border-color);
    }

    @keyframes modalZoomIn {
        from {
            opacity: 0;
            transform: scale(0.6);
        }
        to {
            opacity: 1;
            transform: scale(0.8);
        }
    }

    /* Action buttons responsive */
    .action-btn {
        min-width: 100px;
        font-size: 0.8125rem;
        padding: var(--spacing-sm);
        gap: 0.25rem;
    }

    .action-btn i {
        font-size: 0.875rem;
    }

    /* Stats grid responsive */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-md);
    }

    /* Ingredient cards responsive */
    .ingredients-container {
        grid-template-columns: 1fr;
    }

    /* Recipe cards stay larger on iPad */
    #recipesContainer {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    }

    .ingredient-header {
        padding: var(--spacing-md);
    }

    .ingredient-title {
        font-size: 1.125rem;
    }

    .ingredient-body {
        padding: var(--spacing-md);
    }

    /* Page headers responsive */
    .page-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Home page responsive */
    .home-container {
        padding: 1rem;
    }

    .hero-section {
        padding: 2rem 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-access-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}
    
    .modal-header {
        padding: var(--spacing-lg);
    }
    
    .modal-body {
        padding: var(--spacing-lg);
    }
    
    .modal-footer {
        padding: var(--spacing-lg);
        flex-direction: column-reverse;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

/* ==================== Tag Management ==================== */
.tag-management-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 400px;
    overflow-y: auto;
}

.tag-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: var(--transition-fast);
}

.tag-management-item.inactive {
    opacity: 0.6;
    border-style: dashed;
}

.tag-management-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1;
}

.tag-management-name {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.tag-management-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    max-width: fit-content;
}

.tag-management-usage {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tag-management-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.tag-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    /* Border und background werden durch theme-spezifische Glassmorphism-Styles gesetzt */
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
    min-height: var(--touch-target-min);
    min-width: 120px;
    justify-content: center;
}

.tag-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2) !important;
}

.tag-toggle-btn.active {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.tag-toggle-btn:active {
    transform: scale(0.95);
}

.tag-delete-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
    min-height: var(--touch-target-min);
}

.tag-delete-btn:hover {
    background: var(--danger);
    color: white;
}

.tag-delete-btn:active {
    transform: scale(0.95);
}

.tag-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tag-empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.tag-empty-state i {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-lg);
}

/* ==================== Recipe-Specific Styles ==================== */
.modal-lg {
    max-width: 1000px;
}

/* Wider ingredient selection for better readability */
@media (min-width: 1024px) {
    .modal-lg {
        max-width: 1100px;
    }
}

.form-section {
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    border: 2px solid var(--border);
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border);
}

.recipe-ingredient-item {
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: var(--spacing-md);
    transition: var(--transition-fast);
}

.recipe-ingredient-item:hover {
    border-color: var(--primary);
}

/* Mobile-optimized ingredient input */
@media (max-width: 428px) {
    .recipe-ingredient-item {
        padding: var(--spacing-sm);
        position: relative;
    }
    
    .recipe-ingredient-item .form-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-sm) !important;
    }
    
    .recipe-ingredient-item .form-group {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .recipe-ingredient-item label {
        min-width: 60px;
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    .recipe-ingredient-item .form-control,
    .recipe-ingredient-item select {
        flex: 1;
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.875rem;
        min-height: 36px;
    }
    
    .recipe-ingredient-item .btn-icon {
        position: absolute;
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        min-width: 32px;
        min-height: 32px;
        font-size: 0.875rem;
    }
    
    .form-section-title {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
        padding-bottom: var(--spacing-sm);
    }
    
    /* Kompakte Tags auf mobile */
    .tag {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .tag-input {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

.instruction-item {
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: var(--spacing-md);
    transition: var(--transition-fast);
}

.instruction-item:hover {
    border-color: var(--primary);
}

.instruction-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
}

.ingredients-list,
.instructions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    min-height: 36px;
}

.modal-tag {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ==================== Utility Classes ==================== */
.text-muted {
    color: var(--text-secondary);
}

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

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

/* ==================== Status Badges ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-badge i {
    font-size: 0.875rem;
}

.status-in_progress {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.status-paused {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ==================== Process Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-clickable {
    cursor: pointer;
    position: relative;
}

.stat-card-clickable::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: var(--transition);
    pointer-events: none;
}

.stat-card-clickable:hover::after {
    border-color: var(--primary-color);
}

.stat-card-clickable.stat-card-active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.stat-card-clickable:active {
    transform: translateY(0);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    color: white;
    flex-shrink: 0;
}

.stat-info,
.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* ==================== Action Button Variants ==================== */
.action-btn-success {
    background: var(--success);
    color: white;
    border: none;
}

.action-btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ==================== Small Button Variant ==================== */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ==================== Form Rows ==================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ==================== Ingredients List Editor ==================== */
.ingredients-list-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.ingredient-editor-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.ingredient-editor-item input,
.ingredient-editor-item .form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.ingredient-editor-item input:focus,
.ingredient-editor-item .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ingredient-editor-item .btn-icon {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .ingredient-editor-item {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== Process Details Modal ==================== */
.process-summary {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

.summary-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.summary-amounts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.amount-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.amount-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.amount-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.5;
}

.total-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.total-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.total-value {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ingredients-tracking {
    margin-top: 1.5rem;
}

#ingredientsTrackingList {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ingredient-tracking-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
    transition: var(--transition);
}

.ingredient-tracking-item:hover {
    box-shadow: var(--shadow-sm);
}

.ingredient-tracking-item.completed {
    background: rgba(16, 185, 129, 0.05);
    border-color: var(--success-color);
}

.ingredient-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ingredient-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.ingredient-required {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.ingredient-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 120px;
}

.ingredient-input-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ingredient-input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    width: 100%;
    transition: var(--transition);
}

.ingredient-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ingredient-difference {
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.ingredient-difference.positive {
    color: var(--success-color);
}

.ingredient-difference.negative {
    color: var(--error-color);
}

.ingredient-difference.neutral {
    color: var(--text-tertiary);
}

.ingredient-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ingredient-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--success-color);
}

/* Mobile optimization for ingredient tracking */
@media (max-width: 768px) {
    .ingredient-tracking-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .ingredient-input-group {
        min-width: auto;
    }

    .ingredient-difference {
        text-align: left;
        min-width: auto;
    }

    .ingredient-checkbox {
        justify-content: flex-start;
    }

    .summary-stats,
    .summary-totals,
    .summary-amounts {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ==================== Home Page Specific Styles ==================== */
.home-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.gradient-text {
    text-shadow:
        0 0 10px rgba(99, 102, 241, 0.6),
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 30px rgba(99, 102, 241, 0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Section */
.stats-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.stats-category {
    margin-bottom: 2.5rem;
}

.stats-category-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Quick Access Section */
.quick-access-section {
    margin-bottom: 3rem;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.quick-access-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.quick-access-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.quick-access-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
}

.quick-access-content {
    flex: 1;
}

.quick-access-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.quick-access-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.quick-access-arrow {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.quick-access-card:hover .quick-access-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ==================== THC Overview Card ==================== */
.thc-overview-card {
    display: flex;
    gap: 2rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.thc-total,
.thc-percentage {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.thc-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thc-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

/* THC Table Styles */
.thc-table-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.thc-table-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.thc-table-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.thc-table-header i {
    color: var(--success);
    font-size: 1.25rem;
}

.thc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.thc-table thead {
    background: var(--bg-tertiary);
}

.thc-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.5px;
}

.thc-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.thc-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.thc-table tbody tr:last-child td {
    border-bottom: none;
}

.thc-ingredient-name {
    font-weight: 500;
}

.thc-amount {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.thc-content-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--success);
    font-size: 0.875rem;
}

.thc-total-mg {
    font-weight: 700;
    color: var(--success);
    font-size: 1rem;
}

/* THC Settings UI */
.thc-amounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thc-amount-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: move;
    transition: var(--transition-fast);
}

.thc-amount-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.thc-amount-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.thc-amount-drag-handle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: grab;
}

.thc-amount-drag-handle:active {
    cursor: grabbing;
}

.thc-amount-value {
    flex: 1;
    font-size: 1.125rem;
}

.thc-settings-btn {
    display: inline-flex !important;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .thc-overview-card {
        flex-direction: column;
        gap: 1rem;
    }

    .thc-table-container {
        overflow-x: auto;
    }

    .thc-table {
        font-size: 0.875rem;
    }

    .thc-table th,
    .thc-table td {
        padding: 0.625rem 0.75rem;
    }

    /* Stack tables vertically on mobile for process modal */
    #processTHCSummary > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .thc-table-header h4 {
        font-size: 1rem;
    }

    .thc-amount-item {
        padding: 0.75rem;
    }
}

/* ============================================================
   PRODUCTS PAGE STYLES
   ============================================================ */

/* Product Cards */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Dynamic color overlay for product cards - BASE LAYER with iOS Glass */
.product-card[data-dominant-color] {
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
}

/* Enhanced glassmorphism effect - TIMER BUBBLE STYLE */
.product-card {
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
}

/* Light mode glass for product cards - TIMER BUBBLE STYLE */
[data-theme="light"] .product-card {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

/* Dark mode glass for product cards - TIMER BUBBLE STYLE */
[data-theme="dark"] .product-card {
    background: rgba(31, 41, 55, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

/* Rainbow mode glass for product cards - TIMER BUBBLE STYLE */
[data-theme="rainbow"] .product-card {
    background: rgba(22, 33, 62, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

/* Color overlay with glass effect */
.product-card[data-dominant-color]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-dynamic-color, transparent);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: overlay;
}

.product-card > * {
    position: relative;
    z-index: 1;
}

/* Ensure favorite class works on product cards too */
.product-card.favorite {
    position: relative;
}

/* Product card image should also have the color tint with glass */
.product-card[data-dominant-color] .product-card-image {
    position: relative;
}

.product-card[data-dominant-color] .product-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--card-dynamic-color, transparent) 100%
    );
    opacity: 0.4;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Product card body gets subtle frosted glass effect - TIMER STYLE */
.product-card-body {
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .product-card-body {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="rainbow"] .product-card-body {
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card.inactive {
    opacity: 0.6;
}

.product-card-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.product-photo-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-card-body {
    padding: var(--spacing-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.product-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.product-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: var(--spacing-lg);
}

.product-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Photo Management */
.photos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.photo-item {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.photo-item.main-photo {
    border-color: var(--primary);
    background: var(--primary-light);
}

.photo-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: var(--spacing-sm);
}

.photo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

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

/* Price Tiers */
.price-tiers-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.price-tier-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.price-tier-inputs {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.price-tiers-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.price-tier-display-item {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-tier-quantity,
.price-tier-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Product Gallery */
.product-gallery {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto var(--spacing-lg) auto;
    aspect-ratio: 1 / 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Dynamic color for product detail modal */
#productDetailModal .modal-content[data-dominant-color] {
    position: relative;
}

/* Product detail modal color overlay - Timer Bubble Style */
#productDetailModal .modal-content[data-dominant-color]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-dynamic-color, transparent);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    border-radius: var(--radius-xl);
    mix-blend-mode: overlay;
}

#productDetailModal .modal-body[data-dominant-color] {
    position: relative;
}

#productDetailModal .modal-body > *,
#productDetailModal .modal-header,
#productDetailModal .modal-footer {
    position: relative;
    z-index: 1;
}

.gallery-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-prev {
    left: 1rem;
}

.gallery-next {
    right: 1rem;
}

.gallery-counter {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* Product Detail Info */
.product-detail-info h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.product-detail-info p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.product-detail-meta {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.detail-meta-item i {
    color: var(--primary);
}

/* Modal Extra Large */
.modal-xl {
    max-width: 1200px;
}

/* Modern modal design for Dragieren/Trocknen */
#dragierenModal .modal-content,
#trocknenModal .modal-content {
    background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

#dragierenModal .modal-header,
#trocknenModal .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#dragierenModal .modal-header .btn-icon,
#trocknenModal .modal-header .btn-icon {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 20;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

#dragierenModal .modal-header .btn-icon:hover,
#trocknenModal .modal-header .btn-icon:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

#dragierenModal .machine-settings-section,
#trocknenModal .machine-settings-section {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#dragierenModal .form-group label,
#trocknenModal .form-group label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#dragierenModal .form-control,
#trocknenModal .form-control {
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

#dragierenModal .form-control:focus,
#trocknenModal .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .product-gallery {
        max-width: 100%;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .price-tiers-display {
        grid-template-columns: 1fr;
    }

    .price-tier-inputs {
        grid-template-columns: 1fr;
    }

    .product-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 428px) {
    .product-card-image {
        height: 200px;
    }

    .photos-list {
        grid-template-columns: 1fr;
    }
}

/* ==================== Machine Status Styles ==================== */
.machine-status-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.status-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.status-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.status-icon {
    font-size: 2rem;
    color: var(--primary);
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.stats-display {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-key {
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-value {
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

/* ==================== Machine Control Styles ==================== */
.machine-control-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.machine-control-section h3 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.control-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.command-response {
    margin-top: var(--spacing-lg);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
}

.command-response h4 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.command-response pre {
    background: var(--bg-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
}

/* ==================== Responsive Machine Styles ==================== */
@media (max-width: 768px) {
    .status-grid {
        grid-template-columns: 1fr;
    }

    .status-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
}

/* ==================== Process Type Selection Styles ==================== */
.process-type-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.process-type-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.process-type-card:active {
    transform: translateY(-2px);
}

.process-type-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.process-type-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.process-type-card p {
    font-size: 0.875rem;
}

/* Machine Settings Section */
.machine-settings-section {
    animation: fadeIn 0.3s ease;
}

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

/* Status Items */
.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-value {
    font-size: 1.125rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Responsive adjustments for process type modal */
@media (max-width: 768px) {
    .process-type-card {
        padding: 1.5rem;
    }

    .process-type-icon {
        width: 80px;
        height: 80px;
    }

    .process-type-icon i {
        font-size: 2.5rem !important;
    }
}

/* ==================== Process Chain Builder Modal Styles ==================== */
.modal-process-builder {
    max-width: 1400px !important;
    width: 95vw !important;
    height: 90vh !important;
    max-height: 900px !important;
    box-sizing: border-box;
}

.process-builder-layout {
    display: grid;
    grid-template-columns: 1fr 500px;
    height: 100%;
    gap: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.process-builder-left {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.process-builder-right {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    position: relative;
}

.process-builder-actions {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.process-type-selection-grid {
    display: grid;
    gap: 1rem;
}

.process-type-card-compact {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    width: 100%;
}

.process-type-card-compact:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.process-type-icon-compact {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.process-type-icon-compact i {
    font-size: 1.75rem;
}

.process-type-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.process-type-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.process-chain-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.process-chain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.process-chain-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.process-chain-header .btn-icon {
    color: white;
}

.process-chain-header .btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.process-chain-body {
    padding: 1.5rem;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.process-steps-timeline {
    margin: 1.5rem 0;
    position: relative;
}

.timeline-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.timeline-empty-state i {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.timeline-empty-state p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.timeline-empty-state small {
    font-size: 0.875rem;
}

.process-step-item {
    position: relative;
    padding-left: 4rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid var(--border-color);
    cursor: move;
    cursor: grab;
    transition: all 0.2s ease;
}

.process-step-item:hover {
    background: rgba(99, 102, 241, 0.02);
}

.process-step-item:active {
    cursor: grabbing;
}

.process-step-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.process-step-drag-handle {
    position: absolute;
    left: 0.25rem;
    top: 0;
    width: 1.5rem;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1rem;
    color: var(--text-tertiary);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.process-step-item:hover .process-step-drag-handle {
    opacity: 1;
    color: var(--primary);
}

.process-step-drag-handle i {
    font-size: 1.25rem;
}

.process-step-number {
    position: absolute;
    left: -1rem;
    top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    z-index: 1;
}

.process-step-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    position: relative;
}

.process-step-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.process-step-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.process-step-type.mischen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.process-step-type.dragieren {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.process-step-type.trocknen {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.process-step-actions {
    display: flex;
    gap: 0.25rem;
}

.process-step-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.process-step-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.25rem 0;
}

.process-step-detail-row i {
    margin-right: 0.5rem;
    color: var(--text-tertiary);
}

.process-step-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--warning-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.process-chain-summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

.process-chain-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

/* Drag and Drop States */
.process-step-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.process-step-item.drag-over {
    border-left-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.process-step-item.drag-over::before {
    content: '';
    position: absolute;
    left: -2px;
    top: -4px;
    right: 0;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    animation: pulse 0.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive Process Builder */
@media (max-width: 1200px) {
    .process-builder-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .process-builder-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: 300px;
    }

    .process-builder-right {
        order: -1;
    }

    .modal-process-builder {
        width: 98vw !important;
        height: 95vh !important;
    }
}

@media (max-width: 768px) {
    .process-type-card-compact {
        padding: 1rem;
    }

    .process-type-icon-compact {
        width: 50px;
        height: 50px;
    }

    .process-type-icon-compact i {
        font-size: 1.5rem;
    }

    .process-type-info h4 {
        font-size: 1rem;
    }

    .process-type-info p {
        font-size: 0.8125rem;
    }
}

/* ==================== WebSocket Connection Status ==================== */
.ws-connection-status {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.ws-connection-status:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.ws-status-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ws-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ws-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

.ws-status-dot.connected {
    background: var(--success);
}

.ws-status-dot.disconnected {
    background: var(--danger);
    animation: none;
}

.ws-status-dot.connecting {
    background: var(--warning);
}

.ws-status-dot-large {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

.ws-status-dot-large.connected {
    background: var(--success);
}

.ws-status-dot-large.disconnected {
    background: var(--danger);
    animation: none;
}

.ws-status-dot-large.connecting {
    background: var(--warning);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.ws-status-text {
    font-weight: 600;
    color: var(--text-primary);
}

.ws-status-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* WebSocket Modal Styles */
.ws-info-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.ws-info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ws-info-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.ws-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.ws-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.ws-info-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ws-info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: right;
    word-break: break-all;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ws-connection-status {
        padding: 0.75rem 1rem;
    }

    .ws-status-content {
        gap: 0.25rem;
    }

    .ws-status-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .ws-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .ws-info-value {
        text-align: left;
    }
}

/* ==================== Desktop Optimization - 25% Smaller UI ==================== */
@media (min-width: 1367px) {
    :root {
        /* Spacing - 25% smaller */
        --spacing-xs: 0.1875rem;  /* 0.25 * 0.75 */
        --spacing-sm: 0.375rem;   /* 0.5 * 0.75 */
        --spacing-md: 0.75rem;    /* 1 * 0.75 */
        --spacing-lg: 1.125rem;   /* 1.5 * 0.75 */
        --spacing-xl: 1.5rem;     /* 2 * 0.75 */
        --spacing-2xl: 2.25rem;   /* 3 * 0.75 */

        /* Border Radius - 25% smaller */
        --radius-sm: 0.28125rem;  /* 0.375 * 0.75 */
        --radius: 0.375rem;       /* 0.5 * 0.75 */
        --radius-md: 0.5625rem;   /* 0.75 * 0.75 */
        --radius-lg: 0.75rem;     /* 1 * 0.75 */
        --radius-xl: 1.125rem;    /* 1.5 * 0.75 */
    }

    /* Base Font Size - 25% smaller */
    body {
        font-size: 0.84375rem;  /* 14px * 0.75 = 10.5px, but keeping 14px * 0.9 for readability */
    }

    /* Navbar - 25% smaller */
    .nav-container {
        min-height: 52.5px;  /* 70 * 0.75 */
        padding: 0 var(--spacing-md);
    }

    .nav-brand {
        gap: 0.71rem;  /* 0.95 * 0.75 */
        font-size: 0.890625rem;  /* 1.1875 * 0.75 */
        min-height: 31.35px;  /* 41.8 * 0.75 */
    }

    .nav-brand i {
        font-size: 1.06875rem;  /* 1.425 * 0.75 */
    }

    .nav-link {
        gap: 0.25rem;
        padding: 0.5rem 0.6rem;
        min-height: 44px; /* Touch-optimiert - nicht verkleinern */
        min-width: 44px;
        font-size: 0.85rem;
    }

    /* Cards - Adjusted for readability with wider page */
    .ingredients-container {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));  /* Slightly wider for readability */
        gap: var(--spacing-md);
    }

    #recipesContainer {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));  /* Slightly wider for readability */
        gap: var(--spacing-md);
    }

    .ingredient-card,
    .recipe-card {
        padding: var(--spacing-md);
    }

    .card-header {
        padding: var(--spacing-md);
        font-size: 0.9375rem;  /* 1.25rem * 0.75 */
    }

    .card-title {
        font-size: 1.125rem;  /* 1.5rem * 0.75 */
    }

    .card-subtitle {
        font-size: 0.8203125rem;  /* 1.09375rem * 0.75 */
    }

    /* Buttons - 25% smaller */
    .btn {
        padding: 0.5625rem 1.125rem;  /* 0.75 * 0.75, 1.5 * 0.75 */
        font-size: 0.84375rem;  /* 14px * 0.9 for readability */
        min-height: 33px;  /* 44 * 0.75 */
        gap: 0.375rem;
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;  /* 0.5 * 0.75, 1 * 0.75 */
        font-size: 0.7875rem;  /* 13px * 0.9 */
        min-height: 28.5px;  /* 38 * 0.75 */
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;  /* 1 * 0.75, 2 * 0.75 */
        font-size: 0.9375rem;  /* 1.25rem * 0.75 */
        min-height: 39px;  /* 52 * 0.75 */
    }

    /* Form Controls - 25% smaller */
    .form-control,
    .form-select,
    select.form-control,
    input.form-control,
    textarea.form-control {
        padding: 0.5625rem 0.75rem;  /* 0.75 * 0.75, 1 * 0.75 */
        font-size: 0.84375rem;
        min-height: 33px;  /* 44 * 0.75 */
    }

    .form-label {
        font-size: 0.7875rem;  /* 0.875rem * 0.9 */
        margin-bottom: 0.375rem;
    }

    .form-group {
        margin-bottom: var(--spacing-md);
    }

    /* Page Headers - 25% smaller */
    .page-header {
        padding: var(--spacing-lg) var(--spacing-xl);
        margin-bottom: var(--spacing-lg);
    }

    .page-title {
        font-size: 1.6875rem;  /* 2.25rem * 0.75 */
    }

    .page-subtitle {
        font-size: 0.9375rem;  /* 1.25rem * 0.75 */
    }

    /* Filter Bar - 25% smaller */
    .filter-bar {
        padding: var(--spacing-md) var(--spacing-xl);
        gap: var(--spacing-sm);
    }

    .filter-select {
        padding: 0.5625rem 0.75rem;
        font-size: 0.84375rem;
        min-height: 33px;
    }

    /* Tags - 25% smaller */
    .tag {
        padding: 0.28125rem 0.5625rem;  /* 0.375 * 0.75, 0.75 * 0.75 */
        font-size: 0.6375rem;  /* 0.85rem * 0.75 */
        min-height: 24px;  /* 32 * 0.75 */
    }

    /* Modals - 25% smaller */
    .modal-content {
        max-width: 600px;  /* 800px * 0.75 */
        padding: var(--spacing-lg);
    }

    .modal-header {
        padding: var(--spacing-lg);
    }

    .modal-title {
        font-size: 1.3125rem;  /* 1.75rem * 0.75 */
    }

    .modal-body {
        padding: var(--spacing-lg);
    }

    .modal-footer {
        padding: var(--spacing-lg);
        gap: var(--spacing-sm);
    }

    /* Info Rows in Cards - 25% smaller */
    .info-row {
        gap: 0.5625rem;  /* 0.75rem * 0.75 */
        font-size: 0.7875rem;  /* 0.875rem * 0.9 */
    }

    .info-row i {
        font-size: 0.84375rem;  /* 14px * 0.9 */
    }

    /* Stats Cards - 25% smaller */
    .stat-value {
        font-size: 1.6875rem;  /* 2.25rem * 0.75 */
    }

    .stat-label {
        font-size: 0.7875rem;  /* 0.875rem * 0.9 */
    }

    /* Page Content Padding */
    .page-content {
        padding: var(--spacing-lg) var(--spacing-xl);
    }

    .inventory-page,
    .recipes-page,
    .processes-page {
        padding: 0 var(--spacing-lg);
    }
}

/* ==================== Settings Page Styles ==================== */
.settings-page {
    padding: var(--spacing-lg) 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: var(--spacing-xl);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border);
}

.settings-section-header i {
    font-size: 1.25rem;
    color: var(--primary);
}

.settings-section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
    -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.settings-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.settings-card-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.settings-card-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.settings-card-content {
    padding: var(--spacing-lg);
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.theme-option {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-option i {
    font-size: 1.5rem;
}

.theme-option span {
    font-size: 0.9rem;
    font-weight: 500;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.theme-option.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Settings Slider */
.settings-slider-group {
    margin-bottom: var(--spacing-lg);
}

.settings-slider-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.settings-slider-group .slider-value {
    color: var(--primary);
    font-weight: 600;
    font-family: monospace;
}

.settings-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--primary) 100%);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s;
}

.settings-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.settings-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Settings Preview */
.settings-preview {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.preview-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.settings-preview-card {
    padding: var(--spacing-lg) !important;
}

.settings-preview-card h4 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 1rem;
}

.settings-preview-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toggle Switch */
.settings-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border);
}

.settings-toggle-row:last-of-type {
    border-bottom: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 28px;
    transition: var(--transition);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Settings Hint */
.settings-hint {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius);
    color: var(--info);
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.settings-hint i {
    margin-top: 2px;
}

/* THC Amounts */
.thc-amounts-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.thc-amount-chip {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    border-radius: var(--radius-full);
    color: var(--primary);
    font-weight: 500;
}

.chip-remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition-fast);
    font-size: 0.8rem;
}

.chip-remove:hover {
    background: var(--primary);
    color: white;
}

.thc-add-form {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.thc-add-form input {
    flex: 1;
    max-width: 120px;
}

.unit-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Settings Form Group */
.settings-form-group {
    margin-bottom: var(--spacing-lg);
}

.settings-form-group:last-child {
    margin-bottom: 0;
}

.settings-form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

/* App Info Grid */
.app-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.app-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Mobile Settings */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .theme-selector {
        flex-direction: column;
    }

    .theme-option {
        flex-direction: row;
        justify-content: flex-start;
        padding: var(--spacing-md);
    }

    .theme-option i {
        font-size: 1.25rem;
    }

    .app-info-grid {
        grid-template-columns: 1fr;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
    }
}

/* ==================== iPhone-Specific Fixes ==================== */
@media (max-width: 480px) {
    /* Page Header - Stack vertically */
    .page-header {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .page-header > div:first-child {
        width: 100%;
    }

    /* Page Header Actions - Horizontal scrollable on iPhone */
    .page-header-actions {
        display: flex;
        gap: var(--spacing-sm);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--spacing-sm);
        margin: 0 calc(-1 * var(--spacing-md));
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
        scrollbar-width: none;
        width: calc(100% + 2 * var(--spacing-md));
    }

    .page-header-actions::-webkit-scrollbar {
        display: none;
    }

    .page-header-actions .btn {
        flex-shrink: 0;
        white-space: nowrap;
        width: auto;
        min-width: fit-content;
        font-size: 0.85rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    /* Hide button text, show only icon on very small screens */
    .page-header-actions .btn span {
        display: none;
    }

    /* Legacy support for pages without .page-header-actions */
    .page-header > div:last-child:not(.page-header-actions) {
        display: flex;
        gap: var(--spacing-sm);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--spacing-sm);
        margin: 0 calc(-1 * var(--spacing-md));
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
        scrollbar-width: none;
    }

    .page-header > div:last-child:not(.page-header-actions)::-webkit-scrollbar {
        display: none;
    }

    .page-header > div:last-child:not(.page-header-actions) .btn {
        flex-shrink: 0;
        white-space: nowrap;
        width: auto;
        min-width: fit-content;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    /* Filter Bar - Stack vertically with collapsible filters */
    .filter-bar {
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .search-box {
        width: 100%;
    }

    .filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-sm);
        width: 100%;
    }

    .filter-select {
        font-size: 0.85rem;
        padding: var(--spacing-sm);
        min-height: 44px;
    }

    /* Exclude Tags Button - Full width on last row */
    .exclude-tags-filter {
        grid-column: span 2;
    }

    .exclude-tags-filter .btn {
        width: 100%;
        justify-content: center;
    }

    #excludeTagsDropdown {
        left: 0 !important;
        right: 0 !important;
        width: calc(100vw - 2rem) !important;
        max-width: none !important;
    }

    /* Cards - Full width */
    .ingredients-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: 0;
    }

    .ingredient-card {
        margin: 0;
    }

    /* Ingredient Card Actions */
    .ingredient-header-actions {
        gap: var(--spacing-xs);
    }

    .ingredient-header-actions .btn-icon {
        min-width: 40px;
        min-height: 40px;
        padding: var(--spacing-xs);
    }

    /* Modal Improvements */
    .modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: var(--card-bg);
        z-index: 10;
        padding: var(--spacing-md);
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: var(--spacing-md);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--card-bg);
        padding: var(--spacing-md);
        border-top: 1px solid var(--border);
    }

    .modal-footer .btn {
        flex: 1;
    }

    /* Form Grid - Single column */
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* Tags Display */
    .tags-display {
        max-height: 80px;
        overflow-y: auto;
    }

    .available-tags-bubbles {
        max-height: 100px;
        overflow-y: auto;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Navigation - Icon only */
    .nav-link span {
        display: none !important;
    }

    .nav-links {
        gap: 0.25rem;
    }

    .nav-link {
        padding: var(--spacing-sm);
    }

    /* Timer FAB */
    .timer-fab {
        bottom: calc(env(safe-area-inset-bottom) + 16px);
        left: 16px;
    }

    /* Toast positioning */
    .toast-container {
        bottom: calc(env(safe-area-inset-bottom) + 80px);
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .toast {
        width: 100%;
        max-width: none;
    }

    /* Empty state */
    .empty-state {
        padding: var(--spacing-xl);
    }

    .empty-state i {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .filter-group {
        grid-template-columns: 1fr;
    }

    .exclude-tags-filter {
        grid-column: span 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
