/* Custom Interval Selector Pills */
.routine-interval-pill.active,
.task-interval-pill.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

/* --- Daely 7-Day Meal Plan Grid Styling --- */
.meal-day-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.meal-day-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.4);
}

.meal-day-card.today-highlight {
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
  border: 2px solid #6366f1;
  box-shadow: 0 10px 28px -4px rgba(99, 102, 241, 0.2);
}

.meal-day-card.today-highlight::before {
  content: 'HEUTE';
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* --- Digitales Rezeptbuch --- */
.recipes-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.recipe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.4);
}

.recipe-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 160px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.recipe-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.recipe-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.recipe-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: var(--text-main);
  line-height: 1.3;
}

.recipe-card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.recipe-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* --- Camera OCR Scanner --- */
.ocr-scanner-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 16px auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 2px dashed var(--primary);
}

.ocr-scanner-video {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.ocr-scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border: 3px solid rgba(99, 102, 241, 0.6);
  border-radius: var(--radius-md);
}

.ocr-scanner-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  box-shadow: 0 0 12px #10b981;
  animation: scanLine 2.2s infinite ease-in-out;
}

@keyframes scanLine {
  0% { top: 5%; }
  50% { top: 90%; }
  100% { top: 5%; }
}

/* --- Monthly Trophy Leaderboard --- */
.trophy-banner-card {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(99, 102, 241, 0.08));
  border: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.trophy-winner-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.trophy-icon-large {
  font-size: 2.4rem;
  color: #f59e0b;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.4));
  animation: trophyPulse 2s infinite ease-in-out;
}

@keyframes trophyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* --- Kühlschrank QR Pass --- */
.fridge-pass-container {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

.qr-code-wrapper {
  display: inline-block;
  padding: 16px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 16px 0;
}

/* ==========================================================================
   Routines Module Premium Redesign (.routine-item-card)
   ========================================================================== */
.routine-item-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.routine-item-card:hover {
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.3);
}

.routine-item-card.done {
  background: var(--bg-subtle);
  border-color: rgba(226, 232, 240, 0.8);
  opacity: 0.75;
}

.routine-check-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.custom-check-box {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.custom-check-box.checked {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

.routine-info-wrap {
  flex: 1;
  min-width: 0;
}

.routine-title-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}

.routine-title-text.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.routine-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-time {
  font-size: 0.72rem !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
}

.badge-interval {
  font-size: 0.72rem !important;
  background: rgba(79, 70, 229, 0.08) !important;
  color: var(--primary) !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
}

.routine-actions-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-top: 2px;
}

.btn-routine-delete {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #e11d48;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-routine-delete:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  transform: scale(1.05);
}

/* Person Filter Bar Styling */
#routine-person-filter,
#task-assignee-filter,
#rewards-child-tabs,
#school-child-tabs,
.child-tabs-bar,
.person-filter-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 10px !important;
  padding: 4px 0 12px 0 !important;
  margin-bottom: 16px !important;
  border-bottom: 1.5px solid var(--border-color) !important;
}

#routine-person-filter::-webkit-scrollbar,
#task-assignee-filter::-webkit-scrollbar,
#rewards-child-tabs::-webkit-scrollbar,
#school-child-tabs::-webkit-scrollbar {
  display: none !important;
}

#routine-person-filter button,
#task-assignee-filter button,
#rewards-child-tabs button,
#rewards-child-tabs .tab-btn,
#school-child-tabs button,
.child-tabs-bar .tab-btn,
.person-filter-bar button {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 8px 16px !important;
  border-radius: 20px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-surface) !important;
  color: var(--text-muted) !important;
  transition: all 0.2s ease !important;
}

#routine-person-filter button.active,
#task-assignee-filter button.active,
#rewards-child-tabs button.active,
#rewards-child-tabs .tab-btn.active,
#school-child-tabs button.active,
.child-tabs-bar .tab-btn.active,
.person-filter-bar button.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* Mealplan Modal Responsive Grid & Subtabs */
@media (min-width: 768px) {
  .meal-modal-subtabs {
    display: none !important;
  }
  .meal-modal-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  #meal-box-lunch,
  #meal-box-dinner {
    display: block !important;
  }
}

