/* 🥗 FitnessDEALicious - Clean & Fresh Theme */
/* Design-Philosophie: Sauber, Modern, Einladend - wie N26 + MyFitnessPal */

/* ========== GOOGLE FONTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
  /* 🎨 Color System - Weiß + Grün */
  --color-white: #FFFFFF;
  --color-bg-soft: #F8FAFC;
  --color-border-gray: #E2E8F0;

  --color-green: #22C55E;
  --color-green-dark: #16A34A;
  --color-green-light: #DCFCE7;

  --color-text-primary: #1A1A1A;
  --color-text-secondary: #334155;
  --color-text-muted: #64748B;

  /* 📦 Elevation System (Schatten = Wichtigkeit) */
  --shadow-sm:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.06);

  --shadow-md:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.06);

  --shadow-lg:
    0 10px 15px rgba(0, 0, 0, 0.06),
    0 4px 6px rgba(0, 0, 0, 0.05);

  --shadow-xl:
    0 20px 25px rgba(0, 0, 0, 0.08),
    0 10px 10px rgba(0, 0, 0, 0.04);

  --shadow-green:
    0 4px 14px rgba(34, 197, 94, 0.25);

  /* 🔤 Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* 🎬 Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 📐 Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 📱 iOS Safe Areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* 👆 Touch Targets (Apple HIG: 44px minimum) */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
}

/* ========== GLOBAL STYLES ========== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background: var(--color-white);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ========== BUTTONS ========== */

/* Primary Button (Grün, CTA) */
.btn-primary {
  background: var(--color-green);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-family: var(--font-family);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  cursor: pointer;
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background var(--transition-fast);
  box-shadow: var(--shadow-green);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--color-green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Secondary Button (Ghost, Grüner Border) */
.btn-secondary {
  background: transparent;
  color: var(--color-green);
  border: 2px solid var(--color-green);
  border-radius: var(--radius-md);
  padding: 10px 22px;
  font-family: var(--font-family);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--color-green-light);
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* Tertiary Button (Soft Gray) */
.btn-tertiary {
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-gray);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-family: var(--font-family);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-tertiary:hover {
  background: white;
  border-color: var(--color-text-muted);
}

.btn-tertiary:active {
  transform: scale(0.97);
}

/* Icon Button */
.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-gray);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
  font-size: 18px;
}

.btn-icon:hover {
  background: white;
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.95);
}

/* ========== CARDS ========== */

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border-gray);
  border-radius: var(--radius-lg);
  padding: 0;
  /* Entfernt für bessere Kontrolle - Padding wird in Components gesetzt */
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-soft {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-gray);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: none;
}

/* ========== BADGES ========== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

.badge-green {
  background: transparent;
  color: var(--color-text-primary);
  font-weight: var(--font-medium);
  padding: 2px 0;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--color-border-gray);
}

/* ========== INPUTS ========== */

.input {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border-gray);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-size: var(--text-base);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
  outline: none;
  min-height: 44px;
}

.input::placeholder {
  color: var(--color-text-muted);
}

.input:focus {
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px var(--color-green-light);
  background: var(--color-white);
}

/* ========== PROGRESS BAR ========== */

.progress-bar {
  height: 8px;
  background: var(--color-border-gray);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-green);
  border-radius: var(--radius-full);
  transition: width 600ms cubic-bezier(0.65, 0, 0.35, 1);
}

/* ========== NAVIGATION ========== */

.nav-item {
  position: relative;
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
  padding: 12px 16px;
  transition: color var(--transition-fast);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-item:hover {
  color: var(--color-text-primary);
}

.nav-item.active {
  color: var(--color-green);
  font-weight: var(--font-semibold);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--color-green);
  border-radius: 2px;
}

/* ========== ANIMATIONS ========== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes addToCart {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.3s ease forwards;
}

.animate-cart-bump {
  animation: addToCart var(--transition-bounce);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}

/* Staggered loading */
.card:nth-child(1) {
  animation-delay: 0ms;
}

.card:nth-child(2) {
  animation-delay: 50ms;
}

.card:nth-child(3) {
  animation-delay: 100ms;
}

.card:nth-child(4) {
  animation-delay: 150ms;
}

.card:nth-child(5) {
  animation-delay: 200ms;
}

.card:nth-child(6) {
  animation-delay: 250ms;
}

/* ========== UTILITY CLASSES ========== */

.text-green {
  color: var(--color-green);
}

.text-green-dark {
  color: var(--color-green-dark);
}

.text-primary {
  color: var(--color-text-primary);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-muted {
  color: var(--color-text-muted);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-bold {
  font-weight: var(--font-bold);
}

/* Scrollbar Clean */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Selection Color */
::selection {
  background: var(--color-green-light);
  color: var(--color-green-dark);
}

::-moz-selection {
  background: var(--color-green-light);
  color: var(--color-green-dark);
}

/* ========== MOBILE OPTIMIZATIONS ========== */

@media (max-width: 768px) {
  .card {
    border-radius: var(--radius-md);
  }

  .btn-primary,
  .btn-secondary,
  .btn-tertiary {
    font-size: var(--text-sm);
  }

  /* iOS Zoom-Fix */
  .input {
    font-size: 16px;
  }
}

/* ========== PREMIUM TOUCHES ========== */

/* Smooth focus */
:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Disabled states */
button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-green);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== DARK MODE (Indigo & Slate Theme) ========== */
/* Aktiviert durch html.dark Klasse */

html.dark {
  /* 🎨 Color System - Slate & Indigo */
  --color-white: #1E293B;
  /* Slate 800 - Cards/Surfaces */
  --color-bg-soft: #0F172A;
  /* Slate 950 - Main Background */
  --color-border-gray: #334155;
  /* Slate 700 */

  /* Text Colors */
  --color-text-primary: #F8FAFC;
  /* Slate 50 */
  --color-text-secondary: #CBD5E1;
  /* Slate 300 */
  --color-text-muted: #94A3B8;
  /* Slate 400 */

  /* Accents - Replaced Green with Blue/Slate mix for better look */
  --color-green: #60A5FA;
  /* Blue 400 - Fresh & Clear */
  --color-green-dark: #3B82F6;
  /* Blue 500 */
  --color-green-light: rgba(59, 130, 246, 0.2);
  /* Blue 500 with opacity */

  /* Fallback for "green" semantic meaning (e.g. success messages) */
  --color-success: #4ADE80;

  /* Shadows - Coloured Glows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);

  --shadow-indigo: 0 0 20px rgba(59, 130, 246, 0.4);
  /* Blue Glow */
  --shadow-green: var(--shadow-indigo);
  /* Map old shadow to new style */
}

/* Dark Mode Card-spezifisch */
html.dark .card {
  background: #1E293B;
  /* Slate 800 */
  border-color: #334155;
  /* Slate 700 */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

html.dark .card-soft {
  background: #020617;
  /* Even darker for nested elements */
  border-color: var(--color-border-gray);
}

/* Dark Mode Button Overrides */
html.dark .btn-secondary {
  background: transparent;
  color: var(--color-green);
  border-color: var(--color-green);
}

html.dark .btn-secondary:hover {
  background: var(--color-green-light);
}

html.dark .btn-tertiary {
  background: var(--color-white);
  color: var(--color-text-secondary);
  border-color: var(--color-border-gray);
}

html.dark .btn-tertiary:hover {
  background: var(--color-bg-soft);
  border-color: var(--color-text-muted);
}

/* Dark Mode Input */
html.dark .input {
  background: #020617;
  border-color: var(--color-border-gray);
  color: var(--color-text-primary);
}

html.dark .input:focus {
  background: #020617;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px var(--color-green-light);
}

html.dark .input::placeholder {
  color: var(--color-text-muted);
}

/* Dark Mode Badge */
/* Dark Mode Badge */
html.dark .badge {
  background: var(--color-white);
  color: var(--color-text-secondary);
}

/* Dark Mode Scrollbar */
html.dark ::-webkit-scrollbar-track {
  background: #252525;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #404040;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #505050;
}

/* Dark Mode Selection */
html.dark ::selection {
  background: #1A4D2E;
  color: #DCFCE7;
}

html.dark ::-moz-selection {
  background: #1A4D2E;
  color: #DCFCE7;
}

/* Dark Mode - Navbar & Header */
html.dark nav,
html.dark header {
  background: var(--color-white);
  border-color: var(--color-border-gray);
}

/* Dark Mode - Modals & Overlays */
html.dark .modal,
html.dark [role="dialog"] {
  background: var(--color-white);
  color: var(--color-text-primary);
}

/* Dark Mode - Badges & Labels */
html.dark .badge-green {
  background: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
  /* Blue 300 */
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Dark Mode - Price & Numbers */
html.dark .price,
html.dark [class*="preis"] {
  color: #4ADE80 !important;
  /* Keep Money Green */
}

/* Dark Mode - Images/Cards Background */
html.dark img {
  opacity: 0.9;
}

/* Dark Mode - Hover Effects */
html.dark .nav-item:hover,
html.dark button:hover {
  background: var(--color-bg-soft);
}

html.dark .nav-item.active {
  background: var(--color-green-light) !important;
  color: var(--color-green) !important;
}

/* Dark Mode - Forms & Inputs */
html.dark select,
html.dark textarea {
  background: var(--color-bg-soft);
  border-color: var(--color-border-gray);
  color: var(--color-text-primary);
}

/* Dark Mode - Toast Notifications */
html.dark .toast-notification {
  background: var(--color-white) !important;
  border-color: var(--color-border-gray) !important;
}

/* Dark Mode - Tables */
html.dark table {
  background: var(--color-white);
  color: var(--color-text-primary);
}

html.dark th {
  background: var(--color-bg-soft);
  color: var(--color-text-secondary);
}

html.dark td {
  border-color: var(--color-border-gray);
}

/* Dark Mode - List Items */
html.dark li {
  color: var(--color-text-secondary);
}

/* Dark Mode - Links */
html.dark a {
  color: #4ADE80;
}

html.dark a:hover {
  color: #22C55E;
}

/* ========== DARK MODE ERWEITERT - ALLES DUNKEL ========== */

/* Dark Mode - Root & Body komplett dunkel */
html.dark {
  background: var(--color-bg-soft) !important;
  color: var(--color-text-primary) !important;
}

html.dark body {
  background: var(--color-bg-soft) !important;
  color: var(--color-text-primary) !important;
}

html.dark #root {
  background: var(--color-bg-soft) !important;
}

/* Dark Mode - Alle weißen Hintergründe überschreiben */
html.dark .bg-white {
  background: var(--color-white) !important;
}

html.dark .bg-gray-50,
html.dark .bg-gray-100 {
  background: #020617 !important;
  /* Darker than soft */
}

html.dark .bg-gray-200 {
  background: var(--color-border-gray) !important;
}

/* Dark Mode - Text Colors Override */
html.dark .text-gray-500 {
  color: var(--color-text-muted) !important;
}

html.dark .text-gray-600 {
  color: var(--color-text-muted) !important;
}

html.dark .text-gray-700 {
  color: var(--color-text-secondary) !important;
}

html.dark .text-gray-800,
html.dark .text-gray-900,
html.dark .text-black {
  color: var(--color-text-primary) !important;
}

/* Dark Mode - Border Colors */
html.dark .border,
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 {
  border-color: var(--color-border-gray) !important;
}

/* Dark Mode - Alle Buttons */
html.dark button:not(.btn-primary):not(.btn-secondary):not(.btn-tertiary) {
  background: var(--color-bg-soft);
  color: var(--color-text-primary);
}

/* Dark Mode - Shadow Override */
html.dark .shadow,
html.dark .shadow-sm,
html.dark .shadow-md,
html.dark .shadow-lg,
html.dark .shadow-xl,
html.dark .shadow-2xl {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important;
}

/* Dark Mode - Headings */
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6 {
  color: var(--color-text-primary) !important;
}

html.dark p {
  color: var(--color-text-secondary);
}

/* Dark Mode - Leaflet Map */
html.dark .leaflet-container {
  background: #1A1A1A;
  filter: brightness(0.7) contrast(1.3);
}

html.dark .leaflet-popup-content-wrapper {
  background: var(--color-white) !important;
  color: var(--color-text-primary) !important;
}

html.dark .leaflet-popup-tip {
  background: var(--color-white) !important;
}

/* Dark Mode - Alle Container */
html.dark [class*="container"],
html.dark [class*="wrapper"],
html.dark .max-w-7xl {
  background: transparent;
}

/* Dark Mode - Inline Styles überschreiben (wichtig!) */
html.dark div[style*="background: white"],
html.dark div[style*="background:white"],
html.dark div[style*="backgroundColor: white"],
html.dark div[style*="backgroundColor: 'white'"],
html.dark [style*="background-color: white"],
html.dark [style*="background-color:white"] {
  background: var(--color-white) !important;
}

html.dark [style*="color: #111"],
html.dark [style*="color:#111"],
html.dark [style*="color: '#111'"],
html.dark [style*="color: #1d1d1f"],
html.dark [style*="color:'#1d1d1f'"],
html.dark [style*="color: #374151"],
html.dark [style*="color:'#374151'"] {
  color: var(--color-text-primary) !important;
}

html.dark [style*="color: #6b7280"],
html.dark [style*="color:'#6b7280'"],
html.dark [style*="color: #86868b"],
html.dark [style*="color:'#86868b'"] {
  color: var(--color-text-secondary) !important;
}

html.dark [style*="background: #f9fafb"],
html.dark [style*="backgroundColor: #f9fafb"],
html.dark [style*="backgroundColor: '#f9fafb'"] {
  background: var(--color-bg-soft) !important;
}

html.dark [style*="border: '2px solid #e5e7eb'"],
html.dark [style*="border-color: #e5e7eb"] {
  border-color: var(--color-border-gray) !important;
}

/* Dark Mode - Gradient Backgrounds */
html.dark [class*="gradient"],
html.dark .from-blue-600 {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f2847 100%) !important;
}

/* Dark Mode - Cards in Grid */
html.dark .grid>div>div {
  background: var(--color-white);
}

/* ========== DARK MODE FIXES - Herz, Nährwerte, Filialen ========== */

/* Dark Mode - Favoriten-Button (Herz) - immer sichtbarer weißer Kreis */
html.dark .absolute.rounded-full {
  background: rgba(45, 45, 45, 0.95) !important;
  border: 2px solid #606060 !important;
}

html.dark .absolute.rounded-full:hover {
  background: rgba(60, 60, 60, 0.95) !important;
  border-color: #707070 !important;
}

/* Dark Mode - Nährwerte Container besser lesbar */
html.dark .text-xs {
  color: #CBD5E1 !important;
}

html.dark .font-bold {
  color: #F8FAFC !important;
}

/* Dark Mode - Filial-Informationen (PLZ, Ort) */
html.dark .text-gray-500,
html.dark .text-gray-400 {
  color: #A0A0A0 !important;
}

/* Dark Mode - Datum (Gültig bis) */
html.dark .text-blue-600,
html.dark .text-blue-500 {
  color: #60A5FA !important;
}

/* Dark Mode - Nährwerte Expandierter Bereich */
html.dark .text-slate-900,
html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: #F8FAFC !important;
}

/* Dark Mode - Gradient Backgrounds für Nährwerte */
html.dark .from-red-50,
html.dark .from-orange-50,
html.dark .from-blue-50,
html.dark .from-green-50 {
  background: linear-gradient(135deg, #2D2D2D 0%, #353535 100%) !important;
}

html.dark .bg-blue-50,
html.dark .bg-red-50,
html.dark .bg-orange-50,
html.dark .bg-green-50 {
  background: #2D2D2D !important;
}

/* Dark Mode - Border für Nährwerte-Boxen */
html.dark .border-red-100,
html.dark .border-blue-100,
html.dark .border-orange-100,
html.dark .border-green-100 {
  border-color: #404040 !important;
}

/* Dark Mode - Kalorien Text Gradient lesbar */
html.dark .from-red-600.to-orange-600,
html.dark [class*="bg-gradient-to-r"] {
  background: linear-gradient(135deg, #F87171 0%, #FB923C 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

/* Dark Mode - Filial-Details im Card Footer */
html.dark .text-gray-500.text-xs {
  color: #A8A8A8 !important;
  font-weight: 500;
}

/* Dark Mode - Protein Badge auf Offer Card (grüner Text) */
html.dark span[class*="text-[#34c759]"] {
  color: #4ADE80 !important;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.3);
}

/* Dark Mode - Nutrition Label Text (z.B. "Protein", "Kohlenhydrate", "Fett") */
html.dark .text-xs.md\:text-sm.font-semibold.text-slate-700 {
  color: #E2E8F0 !important;
}

/* Dark Mode - Nutrition Label in general */
html.dark .text-sm.font-semibold {
  color: #F1F5F9 !important;
}

/* Dark Mode - Orange/Green/Blue Text für Nutrition Icons/Labels */
html.dark .text-green-600,
html.dark .text-orange-600,
html.dark .text-cyan-600 {
  filter: brightness(1.3);
}

/* Dark Mode - Improved contrast für kleine Texte */
html.dark .text-xs.opacity-90 {
  opacity: 1 !important;
  color: #CBD5E1 !important;
}

/* ========== MOBILE DARK MODE OPTIMIZATIONS ========== */
@media (max-width: 768px) {

  /* Dark Mode - Mobile Offer Cards */
  html.dark .card {
    background: var(--color-white) !important;
    border-color: var(--color-border-gray) !important;
  }

  /* Dark Mode - Mobile Buttons */
  html.dark .btn-primary,
  html.dark .btn-secondary,
  html.dark .btn-tertiary {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  }

  /* Dark Mode - Mobile Inputs */
  html.dark input,
  html.dark select,
  html.dark textarea {
    background: var(--color-bg-soft) !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border-gray) !important;
  }

  /* Dark Mode - Mobile Heart Button größer und sichtbarer */
  html.dark .absolute.rounded-full {
    background: rgba(55, 55, 55, 0.98) !important;
    border: 2.5px solid #707070 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6) !important;
  }

  /* Dark Mode - Mobile Protein Badge */
  html.dark span[class*="text-[#34c759]"] {
    color: #52FF80 !important;
    text-shadow: 0 0 10px rgba(82, 255, 128, 0.5);
    font-weight: 700 !important;
  }

  /* Dark Mode - Mobile Nutrition Values - größere Schrift */
  html.dark .text-xs {
    color: #D1D5DB !important;
    font-size: 0.75rem !important;
  }

  /* Dark Mode - Mobile Kalorien Badge */
  html.dark .bg-gradient-to-r {
    background: #2D2D2D !important;
  }

  html.dark .text-base,
  html.dark .text-sm {
    color: #F8FAFC !important;
  }

  /* Dark Mode - Mobile Branch Info deutlicher */
  html.dark .text-gray-500,
  html.dark .text-gray-400 {
    color: #B8B8B8 !important;
    font-weight: 500 !important;
  }

  /* Dark Mode - Mobile Ablaufdatum Banner */
  html.dark div[style*="background: #FEE2E2"] {
    background: rgba(220, 38, 38, 0.2) !important;
    border: 1px solid #DC2626 !important;
  }

  /* Dark Mode - Mobile Supermarkt Badge */
  html.dark .absolute.top-2.right-2,
  html.dark .absolute.top-3.right-3 {
    background: rgba(55, 55, 55, 0.95) !important;
  }

  /* Dark Mode - Mobile Filter Panel */
  html.dark .bg-white\/50,
  html.dark .bg-white\/60,
  html.dark .bg-white\/90 {
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(20px);
  }

  /* Dark Mode - Mobile Navigation Tabs */
  html.dark .border-b {
    border-color: #2D2D2D !important;
  }

  /* Dark Mode - Mobile Scrollbar */
  html.dark ::-webkit-scrollbar-track {
    background: #0F0F0F !important;
  }

  html.dark ::-webkit-scrollbar-thumb {
    background: #2D2D2D !important;
  }

  html.dark ::-webkit-scrollbar-thumb:hover {
    background: #404040 !important;
  }
}

/* ========== SHARE MODAL DARK MODE ========== */
/* Dark Mode für Share Shopping List Modal */
html.dark div[style*="backgroundColor: 'white'"][style*="borderRadius: '20px'"] {
  background-color: var(--color-white) !important;
}

html.dark h3[style*="color: '#111'"] {
  color: var(--color-text-primary) !important;
}

html.dark input[readonly] {
  background-color: var(--color-bg-soft) !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-border-gray) !important;
}

html.dark div[style*="backgroundColor: '#f9fafb'"] {
  background-color: var(--color-bg-soft) !important;
}

html.dark div[style*="color: '#6b7280'"] {
  color: var(--color-text-secondary) !important;
}

/* ========== NUTRI TRACKER - MOBILE RESPONSIVE ========== */

/* iPhone SE (375px) - Smallest iPhone */
@media (max-width: 375px) {
  .tracker-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .tracker-card {
    border-radius: 14px !important;
    padding: 14px !important;
  }

  .tracker-macro-card {
    padding: 10px 6px !important;
  }

  .tracker-macro-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .tracker-macro-value {
    font-size: 16px !important;
  }

  .tracker-calories-ring {
    width: 80px !important;
    height: 80px !important;
  }
}

/* iPhone Standard (376px - 430px) */
@media (min-width: 376px) and (max-width: 430px) {
  .tracker-container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .tracker-card {
    border-radius: 16px !important;
  }

  .tracker-calories-ring {
    width: 90px !important;
    height: 90px !important;
  }
}

/* iPhone Pro Max (430px+) */
@media (min-width: 431px) and (max-width: 480px) {
  .tracker-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .tracker-calories-ring {
    width: 100px !important;
    height: 100px !important;
  }
}

/* ========== MODAL BOTTOM SHEET STYLES ========== */
@media (max-width: 768px) {

  /* Bottom Sheet Modal Container */
  .modal-sheet {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    padding-bottom: var(--safe-bottom) !important;
    animation: slideUp 0.3s ease-out;
  }

  /* Full Screen Modal */
  .modal-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    border-radius: 0 !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    padding-top: var(--safe-top) !important;
    padding-bottom: var(--safe-bottom) !important;
  }

  /* Drag Handle for Bottom Sheets */
  .modal-drag-handle {
    width: 36px;
    height: 5px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    margin: 10px auto 16px;
    flex-shrink: 0;
  }

  html.dark .modal-drag-handle {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Modal Overlay */
  .modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
      opacity: 0.5;
    }

    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes slideDown {
    from {
      transform: translateY(0);
      opacity: 1;
    }

    to {
      transform: translateY(100%);
      opacity: 0.5;
    }
  }
}

/* ========== TRACKER TAB NAVIGATION ========== */
@media (max-width: 768px) {
  .tracker-tabs {
    gap: 4px !important;
    padding: 6px !important;
  }

  .tracker-tab {
    min-height: 52px !important;
    padding: 8px 6px !important;
    border-radius: 12px !important;
    font-size: 10px !important;
  }

  .tracker-tab svg {
    width: 22px !important;
    height: 22px !important;
  }

  .tracker-tab.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  }
}

/* ========== TRACKER QUICK ACTIONS ========== */
@media (max-width: 768px) {
  .quick-actions-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 10px !important;
    padding: 4px !important;
    margin: 0 -4px !important;
  }

  .quick-actions-grid::-webkit-scrollbar {
    display: none !important;
  }

  .quick-action-item {
    flex: 0 0 auto !important;
    width: 72px !important;
    scroll-snap-align: start !important;
  }
}

/* iPhone SE specific */
@media (max-width: 375px) {
  .quick-action-item {
    width: 64px !important;
  }
}

/* ========== TRACKER WATER GLASSES ========== */
@media (max-width: 768px) {
  .water-glass-grid {
    gap: 6px !important;
  }

  .water-glass-btn {
    width: 32px !important;
    height: 40px !important;
  }

  .water-glass-btn svg {
    width: 28px !important;
    height: 36px !important;
  }
}

/* iPhone SE */
@media (max-width: 375px) {
  .water-glass-btn {
    width: 28px !important;
    height: 36px !important;
  }

  .water-glass-btn svg {
    width: 24px !important;
    height: 32px !important;
  }
}

/* ========== TRACKER MEAL SELECTOR ========== */
@media (max-width: 768px) {
  .meal-selector-grid {
    gap: 10px !important;
  }

  .meal-selector-btn {
    padding: 12px 10px !important;
    min-height: 52px !important;
    border-radius: 14px !important;
  }

  .meal-selector-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  .meal-selector-btn span {
    font-size: 12px !important;
  }
}

/* ========== TRACKER SEARCH INPUT ========== */
@media (max-width: 768px) {
  .tracker-search-input {
    min-height: 48px !important;
    font-size: 16px !important;
    /* Prevents iOS zoom */
    padding: 12px 16px !important;
    padding-left: 44px !important;
    padding-right: 90px !important;
  }

  .tracker-search-icon {
    left: 14px !important;
    width: 20px !important;
    height: 20px !important;
  }

  .tracker-search-buttons {
    gap: 6px !important;
    right: 8px !important;
  }

  .tracker-search-btn {
    width: 38px !important;
    height: 38px !important;
    padding: 8px !important;
  }
}

/* ========== SAFE AREA UTILITIES ========== */
.safe-top {
  padding-top: var(--safe-top) !important;
}

.safe-bottom {
  padding-bottom: var(--safe-bottom) !important;
}

.safe-x {
  padding-left: var(--safe-left) !important;
  padding-right: var(--safe-right) !important;
}

.safe-all {
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left) !important;
}

/* ========== DESKTOP ENHANCEMENTS ========== */
@media (min-width: 769px) {

  /* Hover effects only on desktop */
  .tracker-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }

  .tracker-tab:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
  }

  html.dark .tracker-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
  }

  /* Modal centered on desktop */
  .modal-sheet {
    position: relative !important;
    border-radius: 20px !important;
    max-width: 480px !important;
    margin: auto !important;
  }
}

/* Disable hover transforms on touch devices */
@media (hover: none) {

  .tracker-card:hover,
  .tracker-tab:hover {
    transform: none !important;
  }
}

/* ========== ANGEBOTE DASHBOARD - MOBILE RESPONSIVE ========== */

/* Main Container */
@media (max-width: 768px) {
  .angebote-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 80px) !important;
  }
}

/* Angebote Header - Sticky with Safe Area */
@media (max-width: 768px) {
  .angebote-header {
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* Angebote Tabs */
@media (max-width: 768px) {
  .angebote-tabs {
    gap: 4px !important;
    padding: 6px !important;
  }

  .angebote-tab {
    padding: 10px 12px !important;
    font-size: 12px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
  }

  .angebote-tab span:first-child {
    font-size: 14px !important;
  }
}

/* iPhone SE */
@media (max-width: 375px) {
  .angebote-tab {
    padding: 8px 10px !important;
    font-size: 11px !important;
  }
}

/* Stats Card Mobile */
@media (max-width: 768px) {
  .angebote-stats-card {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .angebote-stats-card .stats-ring {
    width: 72px !important;
    height: 72px !important;
  }

  .angebote-stats-card .stats-ring span {
    font-size: 20px !important;
  }

  .angebote-stats-card .stats-mini {
    padding: 10px 8px !important;
    border-radius: 14px !important;
  }

  .angebote-stats-card .stats-mini-value {
    font-size: 16px !important;
  }

  .angebote-stats-card .stats-mini-label {
    font-size: 9px !important;
  }
}

/* iPhone SE Stats */
@media (max-width: 375px) {
  .angebote-stats-card {
    padding: 12px !important;
  }

  .angebote-stats-card .stats-ring {
    width: 64px !important;
    height: 64px !important;
  }

  .angebote-stats-card .stats-mini {
    padding: 8px 6px !important;
  }
}

/* Deal Source Switcher */
@media (max-width: 768px) {
  .deal-source-grid {
    gap: 10px !important;
  }

  .deal-source-btn {
    padding: 14px 10px !important;
    border-radius: 16px !important;
  }

  .deal-source-btn .icon-wrap {
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
  }

  .deal-source-btn .icon-wrap span {
    font-size: 18px !important;
  }

  .deal-source-btn .label {
    font-size: 11px !important;
  }

  .deal-source-btn .count {
    font-size: 10px !important;
    padding: 2px 8px !important;
  }
}

/* Shop/Brand Filter Scroll */
@media (max-width: 768px) {
  .shop-filter-scroll {
    padding: 8px 0 !important;
    gap: 12px !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
  }

  .shop-filter-item {
    min-width: 60px !important;
    scroll-snap-align: start !important;
  }

  .shop-filter-item .logo-circle {
    width: 52px !important;
    height: 52px !important;
  }

  .shop-filter-item .logo-circle img {
    padding: 8px !important;
  }

  .shop-filter-item .shop-name {
    font-size: 10px !important;
    max-width: 56px !important;
  }
}

/* iPhone SE Shop Filter */
@media (max-width: 375px) {
  .shop-filter-item {
    min-width: 52px !important;
  }

  .shop-filter-item .logo-circle {
    width: 44px !important;
    height: 44px !important;
  }

  .shop-filter-item .shop-name {
    font-size: 9px !important;
    max-width: 48px !important;
  }
}

/* Search & Filter Card */
@media (max-width: 768px) {
  .angebote-search-card {
    border-radius: 16px !important;
  }

  .angebote-search-input {
    min-height: 48px !important;
    font-size: 16px !important;
    /* Prevents iOS zoom */
    padding: 12px 16px !important;
    padding-left: 40px !important;
    border-radius: 14px !important;
  }

  .angebote-category-chips {
    gap: 8px !important;
    padding: 12px 0 !important;
  }

  .angebote-category-chip {
    padding: 10px 14px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
    min-height: 44px !important;
  }
}

/* Expanded Filters */
@media (max-width: 768px) {
  .angebote-filters-expanded {
    padding: 12px !important;
    gap: 12px !important;
  }

  .angebote-filter-btn {
    padding: 10px 12px !important;
    font-size: 11px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
  }

  .angebote-filter-input {
    min-height: 44px !important;
    font-size: 16px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }

  .angebote-filter-select {
    min-height: 44px !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
  }
}

/* Offers Grid Mobile */
@media (max-width: 768px) {
  .offers-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

/* iPhone SE - Single Column Option */
@media (max-width: 375px) {
  .offers-grid {
    gap: 10px !important;
  }
}

/* Offer Card Mobile */
@media (max-width: 768px) {
  .offer-card {
    border-radius: 18px !important;
  }

  .offer-card .shop-badge {
    padding: 4px 8px !important;
    font-size: 9px !important;
    border-radius: 8px !important;
  }

  .offer-card .discount-badge {
    padding: 4px 8px !important;
    font-size: 9px !important;
    border-radius: 8px !important;
  }

  .offer-card .product-name {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  .offer-card .product-price {
    font-size: 16px !important;
  }

  .offer-card .product-weight {
    font-size: 9px !important;
  }

  .offer-card .brand-label {
    font-size: 9px !important;
  }
}

/* iPhone SE Offer Card */
@media (max-width: 375px) {
  .offer-card {
    border-radius: 14px !important;
  }

  .offer-card .product-name {
    font-size: 12px !important;
  }

  .offer-card .product-price {
    font-size: 14px !important;
  }
}

/* Offer Overlay - Bottom Sheet on Mobile */
@media (max-width: 768px) {
  .offer-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .offer-overlay-content {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    border-radius: 24px 24px 0 0 !important;
    flex-direction: column !important;
    animation: slideUp 0.3s ease-out !important;
  }

  .offer-overlay-image {
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
    flex-shrink: 0 !important;
  }

  .offer-overlay-details {
    padding: 20px !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .offer-overlay-price {
    font-size: 40px !important;
  }

  .offer-overlay-tags {
    gap: 6px !important;
  }

  .offer-overlay-tag {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  .offer-overlay-nutrition {
    padding: 16px !important;
    border-radius: 20px !important;
    margin-bottom: 16px !important;
  }

  .offer-overlay-actions {
    gap: 10px !important;
  }

  .offer-overlay-action-btn {
    padding: 16px !important;
    font-size: 15px !important;
    border-radius: 16px !important;
    min-height: 56px !important;
  }

  .offer-overlay-fav-btn {
    width: 56px !important;
    min-height: 56px !important;
    border-radius: 16px !important;
    font-size: 24px !important;
  }
}

/* Shopping List Sidebar Mobile */
@media (max-width: 768px) {
  .shopping-list-sidebar {
    width: 100% !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
  }

  .shopping-list-header {
    padding: 16px !important;
    padding-top: calc(env(safe-area-inset-top, 0px) + 16px) !important;
  }

  .shopping-list-header h2 {
    font-size: 20px !important;
  }

  .shopping-list-stats {
    gap: 8px !important;
  }

  .shopping-list-stat {
    padding: 10px 8px !important;
    border-radius: 14px !important;
  }

  .shopping-list-stat-value {
    font-size: 18px !important;
  }

  .shopping-list-stat-label {
    font-size: 10px !important;
  }

  .shopping-list-items {
    padding: 16px !important;
  }

  .shopping-list-item {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .shopping-list-item-name {
    font-size: 13px !important;
  }

  .shopping-list-qty-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }

  .shopping-list-footer {
    padding: 16px !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
  }

  .shopping-list-summary-card {
    padding: 12px !important;
    border-radius: 14px !important;
  }

  .shopping-list-action-btn {
    padding: 14px !important;
    font-size: 14px !important;
    border-radius: 14px !important;
    min-height: 52px !important;
  }
}

/* Shopping List FAB */
@media (max-width: 768px) {
  .shopping-list-fab {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
    right: 16px !important;
    width: 56px !important;
    height: 56px !important;
  }

  .shopping-list-fab svg {
    width: 26px !important;
    height: 26px !important;
  }

  .shopping-list-fab .badge {
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
  }
}

/* Map View Mobile */
@media (max-width: 768px) {
  .angebote-map {
    height: calc(100vh - 180px) !important;
    height: calc(100dvh - 180px) !important;
    border-radius: 20px !important;
    margin: 0 -12px !important;
    width: calc(100% + 24px) !important;
  }
}

/* Favorites Grid Mobile */
@media (max-width: 768px) {
  .favorites-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .favorites-empty {
    padding: 40px 20px !important;
    border-radius: 20px !important;
  }

  .favorites-empty-icon {
    font-size: 48px !important;
    margin-bottom: 12px !important;
  }
}

/* Shopping List View (Tab) Mobile */
@media (max-width: 768px) {
  .shopping-list-view-item {
    padding: 12px !important;
    border-radius: 16px !important;
    gap: 12px !important;
  }

  .shopping-list-view-item img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
  }

  .shopping-list-view-item h4 {
    font-size: 13px !important;
  }

  .shopping-list-view-empty {
    padding: 40px 20px !important;
    border-radius: 20px !important;
  }
}

/* Desktop Enhancements for Angebote */
@media (min-width: 769px) {
  .offer-card:hover {
    transform: translateY(-4px) !important;
  }

  .offer-overlay-content {
    max-width: 1024px !important;
  }

  .shopping-list-sidebar {
    width: 500px !important;
  }
}

/* Disable hover transforms on touch for Angebote */
@media (hover: none) {

  .offer-card:hover,
  .deal-source-btn:hover,
  .shop-filter-item:hover {
    transform: none !important;
  }
}