/* ============================================
   MA POPOTE - Leftovers & Anti-Waste
   Page-specific styles
   ============================================ */

/* ---- Leftovers Header ---- */
.leftovers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.leftovers-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.leftovers-header .anti-waste-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--accent-success-light);
  color: var(--accent-success);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
}


/* ---- Anti-Waste Score ---- */
.anti-waste-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2xl) var(--space-lg);
  background-color: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}

.anti-waste-score .score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: var(--space-lg);
}

.anti-waste-score .score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.anti-waste-score .score-ring .ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.anti-waste-score .score-ring .ring-fill {
  fill: none;
  stroke: var(--accent-success);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.anti-waste-score .score-ring .score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.anti-waste-score .score-ring .score-number {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--accent-success);
  line-height: 1;
}

.anti-waste-score .score-ring .score-unit {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.anti-waste-score .score-label {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 var(--space-xs) 0;
}

.anti-waste-score .score-description {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
  max-width: 320px;
  margin: 0;
}


/* ---- Leftover List ---- */
.leftover-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}


/* ---- Leftover Item ---- */
.leftover-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  cursor: pointer;
}

.leftover-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.leftover-item .food-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.leftover-item .leftover-info {
  flex: 1;
  min-width: 0;
}

.leftover-item .leftover-name {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.leftover-item .leftover-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.leftover-item .leftover-qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.leftover-item .leftover-expiry {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.leftover-item .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

.leftover-item .status-badge.fresh {
  background-color: var(--accent-success-light);
  color: var(--accent-success);
}

.leftover-item .status-badge.expiring {
  background-color: var(--accent-warning-light);
  color: var(--accent-warning);
}

.leftover-item .status-badge.expired {
  background-color: var(--accent-error-light);
  color: var(--accent-error);
}

/* Expiring state */
.leftover-item.expiring {
  border-color: var(--accent-warning);
  background-color: var(--accent-warning-light);
}

.leftover-item.expiring:hover {
  border-color: var(--accent-warning);
  box-shadow: 0 4px 6px rgba(217, 119, 6, 0.12);
}

/* Expired state */
.leftover-item.expired {
  border-color: var(--accent-error);
  opacity: 0.7;
}

.leftover-item.expired:hover {
  border-color: var(--accent-error);
  box-shadow: 0 4px 6px rgba(197, 48, 48, 0.1);
}

.leftover-item.expired .leftover-name {
  color: var(--text-secondary);
}


/* ---- Leftover Add Button ---- */
.leftover-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md);
  background-color: var(--bg-surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
}

.leftover-add-btn:hover {
  background-color: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.leftover-add-btn .add-icon {
  font-size: var(--text-lg);
}


/* ---- Leftover Suggestions ---- */
.leftover-suggestions {
  margin-top: var(--space-xl);
}

.leftover-suggestions h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-md) 0;
}

.leftover-suggestions .suggestion-scroll {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--space-sm);
}

.leftover-suggestions .suggestion-scroll::-webkit-scrollbar {
  display: none;
}

.leftover-suggestions .suggestion-scroll .card-recipe {
  min-width: 220px;
  max-width: 260px;
  flex-shrink: 0;
}

.leftover-suggestions .suggestion-scroll .card-recipe .match-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 2px 8px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--accent-success);
  background-color: var(--accent-success-light);
  border-radius: var(--radius-full);
  margin-top: var(--space-xs);
}


/* ---- Responsive ---- */

/* Mobile */
@media (max-width: 767px) {
  .leftovers-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .leftovers-header h1 {
    font-size: var(--text-xl);
  }

  .anti-waste-score {
    padding: var(--space-xl) var(--space-md);
  }

  .anti-waste-score .score-ring {
    width: 120px;
    height: 120px;
  }

  .anti-waste-score .score-ring .score-number {
    font-size: var(--text-2xl);
  }

  .leftover-item {
    padding: var(--space-sm) var(--space-md);
  }

  .leftover-item .food-icon {
    width: 36px;
    height: 36px;
    font-size: var(--text-lg);
  }

  .leftover-suggestions .suggestion-scroll .card-recipe {
    min-width: 200px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .leftover-list {
    max-width: 800px;
  }

  .anti-waste-score {
    flex-direction: row;
    gap: var(--space-2xl);
    padding: var(--space-xl) var(--space-2xl);
    text-align: left;
  }

  .anti-waste-score .score-ring {
    margin-bottom: 0;
  }

  .anti-waste-score .score-label,
  .anti-waste-score .score-description {
    text-align: left;
  }
}
