/* ===== CSS Custom Properties ===== */
:root {
  --color-green: #4CAF50;
  --color-green-light: #C8E6C9;
  --color-green-bg: #E8F5E9;
  --color-yellow: #FFB300;
  --color-yellow-light: #FFF8E1;
  --color-gray: #BDBDBD;
  --color-gray-light: #F5F5F5;
  --color-bg: #F0F7E6;
  --color-header: #66BB6A;
  --color-header-text: #fff;
  --color-pink: #F48FB1;
  --color-sky: #B3E5FC;
  --color-sunshine: #FFF176;
  --color-card-bg: #FFFFFF;
  --color-text: #33691E;
  --color-text-light: #689F38;
  --color-text-dark: #1B5E20;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --font-main: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 2rem;
}

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--color-header) 0%, #43A047 100%);
  color: var(--color-header-text);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.app-logo {
  font-size: 2rem;
  line-height: 1;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ===== Weather Widget ===== */
.weather-widget {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.4rem 0.8rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.weather-icon {
  font-size: 1.3rem;
}

.weather-temp {
  font-weight: 700;
}

.weather-city {
  opacity: 0.85;
  font-size: 0.8rem;
}

/* ===== Greeting Section ===== */
.greeting {
  text-align: center;
  padding: 1.25rem 1rem 0.5rem;
}

.date-display {
  font-size: 0.95rem;
  color: var(--color-text-light);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.greeting-text {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-text-dark);
}

/* ===== Category Tabs ===== */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 2rem;
  background: var(--color-card-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.tab:active {
  transform: scale(0.95);
}

.tab.active {
  background: var(--color-header);
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* ===== Content ===== */
.content {
  padding: 0 1rem;
}

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.25rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text-dark);
}

.section-header .section-icon {
  font-size: 1.3rem;
}

.section-header.jetzt { color: #2E7D32; }
.section-header.bald { color: #F57F17; }
.section-header.tipp { color: #6A1B9A; }
.section-header.rezepte { color: #D84315; }
.section-header.vorbei { color: #9E9E9E; }

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

/* ===== Season Card ===== */
.season-card {
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
}

.season-card:active {
  transform: scale(0.96);
}

.season-card.status-jetzt {
  border-color: var(--color-green);
  background: linear-gradient(180deg, #E8F5E9 0%, #fff 40%);
}

.season-card.status-bald {
  border-color: var(--color-yellow);
  background: linear-gradient(180deg, #FFF8E1 0%, #fff 40%);
}

.season-card.status-vorbei,
.season-card.status-warten {
  border-color: #E0E0E0;
  opacity: 0.65;
}

.card-image {
  width: 100%;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin: -1rem -1rem 0.5rem -1rem;
  width: calc(100% + 2rem);
}

.card-emoji {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 0.4rem;
  display: block;
}

.card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.card-category {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.3rem;
}

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-status.jetzt {
  background: var(--color-green);
  color: white;
}

.card-status.bald {
  background: var(--color-yellow);
  color: #4E342E;
}

.card-status.vorbei,
.card-status.warten {
  background: #E0E0E0;
  color: #757575;
}

.card-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Pulse animation for "BALD" */
.season-card.status-bald .card-status-dot {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* Fade-in animation for cards */
.season-card {
  animation: fadeInUp 0.4s ease-out both;
}

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

/* Stagger animation */
.card-grid .season-card:nth-child(1) { animation-delay: 0.05s; }
.card-grid .season-card:nth-child(2) { animation-delay: 0.1s; }
.card-grid .season-card:nth-child(3) { animation-delay: 0.15s; }
.card-grid .season-card:nth-child(4) { animation-delay: 0.2s; }
.card-grid .season-card:nth-child(5) { animation-delay: 0.25s; }
.card-grid .season-card:nth-child(6) { animation-delay: 0.3s; }
.card-grid .season-card:nth-child(7) { animation-delay: 0.35s; }
.card-grid .season-card:nth-child(8) { animation-delay: 0.4s; }

/* ===== Tip Card ===== */
.tip-card {
  background: linear-gradient(135deg, #EDE7F6 0%, #E8EAF6 100%);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin: 1rem 0;
  box-shadow: var(--shadow);
  border-left: 4px solid #7E57C2;
}

.tip-card .tip-header {
  font-size: 1rem;
  font-weight: 800;
  color: #4A148C;
  margin-bottom: 0.4rem;
}

.tip-card .tip-text {
  font-size: 0.95rem;
  color: #4A148C;
  line-height: 1.5;
  font-weight: 600;
}

/* ===== Recipe Card ===== */
.recipe-card {
  background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  border: 2px solid #FFB74D;
}

.recipe-card:active {
  transform: scale(0.97);
}

.recipe-emoji {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}

.recipe-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #BF360C;
  margin-bottom: 0.15rem;
}

.recipe-desc {
  font-size: 0.8rem;
  color: #D84315;
  font-weight: 600;
}

.recipe-difficulty {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  margin-top: 0.3rem;
  background: #FFB74D;
  color: #4E342E;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: flex-end;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--color-card-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 80dvh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  animation: slideUp 0.3s ease-out;
  -webkit-overflow-scrolling: touch;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: var(--color-gray-light);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #757575;
  font-family: var(--font-main);
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:active {
  background: #E0E0E0;
}

/* Modal content styling */
.modal-image {
  display: block;
  width: calc(100% + 3rem);
  aspect-ratio: 5 / 2;
  object-fit: cover;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  margin: -1.5rem -1.5rem 1rem -1.5rem;
}

.modal-emoji {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--color-text-dark);
  margin-bottom: 0.25rem;
}

.modal-status {
  text-align: center;
  margin-bottom: 1rem;
}

.modal-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--color-text);
  font-weight: 600;
}

.modal-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-text-dark);
  margin: 1rem 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.modal-tip {
  background: var(--color-green-bg);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2E7D32;
  line-height: 1.5;
}

.modal-recipes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.modal-recipe-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  background: #FFF3E0;
  border: 2px solid #FFB74D;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #BF360C;
  cursor: pointer;
  font-family: var(--font-main);
  -webkit-tap-highlight-color: transparent;
}

.modal-recipe-link:active {
  background: #FFE0B2;
}

/* Recipe modal specifics */
.recipe-ingredients {
  list-style: none;
  padding: 0;
}

.recipe-ingredients li {
  padding: 0.3rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid #F5F5F5;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recipe-ingredients li::before {
  content: "\2022";
  color: var(--color-green);
  font-weight: 800;
}

.recipe-steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.recipe-steps li {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  display: flex;
  gap: 0.75rem;
  counter-increment: step;
}

.recipe-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--color-header);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 0.1rem;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-light);
}

.empty-state .empty-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.empty-state .empty-text {
  font-size: 1rem;
  font-weight: 700;
}

/* ===== Weather States ===== */
.weather-widget.loading {
  opacity: 0.6;
}

.weather-advice {
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-light);
}

/* ===== iPad Landscape ===== */
@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
  }

  .content {
    padding: 0 2rem;
    max-width: 1000px;
    margin: 0 auto;
  }

  .greeting {
    padding: 1.5rem 2rem 0.75rem;
  }

  .greeting-text {
    font-size: 1.6rem;
  }

  .modal {
    border-radius: var(--radius-xl);
    max-width: 500px;
    max-height: 75dvh;
    margin: auto;
  }

  .modal-overlay {
    align-items: center;
  }

  .app-header {
    padding: 0.75rem 2rem;
  }
}

/* ===== Large iPad / iPad Pro ===== */
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}
