@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- DESIGN SYSTEM & TOKENS --- */
:root {
  --font-primary: 'Plus Jakarta Sans', sans-serif;
  --bg-main: #0B0F19;
  --bg-card: rgba(17, 24, 39, 0.55);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(236, 72, 153, 0.4);
  
  --primary-glow: linear-gradient(135deg, #EC4899 0%, #7C3AED 100%);
  --secondary-glow: rgba(236, 72, 153, 0.12);
  
  --color-text-main: #F3F4F6;
  --color-text-muted: #9CA3AF;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-elastic: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}

/* --- RESET & GLOBAL STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--color-text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(236, 72, 153, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* --- HEADER --- */
header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.2rem 0;
  background: rgba(9, 13, 26, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #FFF;
}

/* --- GLASS CONTAINER --- */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 2.2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.4s ease-out;
}

/* --- FORM LAYOUT --- */
.form-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.form-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #FFF;
}

.form-header p {
  color: var(--color-text-muted);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.6rem;
}

.form-row {
  display: flex;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

.flex-1 {
  flex: 1;
}

/* Number & Toggle inputs */
input[type="number"] {
  font-family: var(--font-primary);
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: #FFF;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-smooth);
}

input[type="number"]:focus {
  border-color: #EC4899;
  background: rgba(255, 255, 255, 0.06);
}

.input-info {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

/* Toggle Card */
.toggle-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.toggle-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.toggle-content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.toggle-icon {
  font-size: 1.8rem;
  background: rgba(255, 255, 255, 0.04);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-content strong {
  display: block;
  font-size: 0.95rem;
  color: #FFF;
}

.toggle-content p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.toggle-card:has(input:checked) {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.toggle-card:has(input:checked) .toggle-icon {
  background: rgba(16, 185, 129, 0.2);
}

/* --- BUTTONS --- */
.btn {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.8rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-elastic);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-glow);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.btn-block {
  width: 100%;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
}

/* --- RESULTS HEADERS --- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #FFF;
}

/* --- MENU GRID --- */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.day-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition-smooth);
}

.day-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.day-title {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #EC4899;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.meal-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meal-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.meal-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFF;
  line-height: 1.4;
}

.recipe-link {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  transition: var(--transition-smooth);
  width: fit-content;
}

.recipe-link:hover {
  color: #EC4899;
}

.meal-dessert {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* --- YOGURT CARD --- */
.yogurt-card {
  background: rgba(236, 72, 153, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: 0 5px 15px rgba(236, 72, 153, 0.05);
}

.yogurt-icon {
  font-size: 2.2rem;
  background: rgba(236, 72, 153, 0.15);
  width: 55px;
  height: 55px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yogurt-details h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #EC4899;
  margin-bottom: 0.2rem;
}

.yogurt-details p {
  font-size: 0.85rem;
  color: var(--color-text-main);
  line-height: 1.4;
}

/* --- SHOPPING LIST --- */
.list-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  margin-top: -1rem;
}

.shopping-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

@media (max-width: 500px) {
  .shopping-categories {
    grid-template-columns: 1fr;
  }
}

.category-box {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
}

.category-box h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  color: #FFF;
  border-left: 3px solid #EC4899;
  padding-left: 0.6rem;
}

.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ingredient-item {
  transition: var(--transition-smooth);
}

.check-item-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  position: relative;
  width: 100%;
}

.check-item-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.check-item-container input[type="checkbox"]:checked ~ .custom-checkbox {
  background: #EC4899;
  border-color: #EC4899;
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.3);
}

.check-item-container input[type="checkbox"]:checked ~ .custom-checkbox::after {
  content: "✓";
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 800;
}

.ingredient-name-qty {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-main);
  transition: var(--transition-smooth);
}

.ingredient-item.checked .ingredient-name-qty {
  text-decoration: line-through;
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- PRINT MEDIA RULES --- */
@media print {
  body {
    background: #FFFFFF !important;
    color: #111111 !important;
    background-image: none !important;
  }

  header, 
  #btn-edit-criteria, 
  #btn-print {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .glass-panel {
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 2cm !important;
  }

  h2 {
    color: #111111 !important;
    border-bottom: 2px solid #111111 !important;
    padding-bottom: 0.2cm !important;
    font-size: 16pt !important;
    margin-top: 1cm !important;
  }

  .day-card {
    border: 1px solid #ddd !important;
    background: none !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  .day-title {
    color: #111111 !important;
    border-bottom: 1px solid #111111 !important;
    font-weight: bold !important;
  }

  .recipe-link {
    display: none !important; /* Hide links on paper */
  }

  .yogurt-card {
    border: 1px solid #111111 !important;
    background: none !important;
    color: #111111 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  .yogurt-icon {
    display: none !important;
  }

  .shopping-categories {
    display: block !important;
  }

  .category-box {
    border: none !important;
    border-bottom: 1px solid #ccc !important;
    padding: 0.5cm 0 !important;
    background: none !important;
    page-break-inside: avoid !important;
  }

  .category-box h3 {
    color: #111111 !important;
    border-left: 4px solid #111111 !important;
    font-size: 12pt !important;
  }

  .custom-checkbox {
    border: 1px solid #111111 !important;
  }

  .ingredient-name-qty {
    color: #111111 !important;
    font-size: 10pt !important;
  }

  /* Keep checkboxes clean but visible */
  input[type="checkbox"]:checked ~ .custom-checkbox {
    background: #666 !important;
  }
}
