/**
 * TDF Diet Planner - Frontend Styles
 * Version: 1.0.0
 * Author: Sean Shepley
 */

/* Container */
.tdf-diet-planner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 100%);
  min-height: 100vh;
}

/* Header & Navigation */
.tdf-diet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tdf-back-to-members {
  text-decoration: none;
  font-size: 0.9rem;
}

.tdf-diet-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  flex: 1;
}

.tdf-diet-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tdf-nav-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-nav-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.tdf-nav-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Dashboard Grid */
.tdf-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tdf-dashboard-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: none;
  position: relative;
  overflow: hidden;
}

.tdf-dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.tdf-dashboard-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.5rem 0;
}

/* Card Accent Colors */
.tdf-progress-card::before {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

.tdf-profile-summary-card::before {
  background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

.tdf-current-plan-card::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.tdf-period-progress-card::before {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

/* Period Progress Card Styles */
.tdf-period-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tdf-period-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-period-tab:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}

.tdf-period-tab.active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border-color: #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.tdf-period-progress-display {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tdf-period-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.tdf-period-stat {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
}

.tdf-period-stat-label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.tdf-period-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

.tdf-period-bar-container {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1rem;
  border-radius: 10px;
}

.tdf-period-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #475569;
  font-weight: 500;
}

.tdf-period-bar {
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.tdf-period-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 6px;
  transition: width 0.5s ease, background 0.3s ease;
}

.tdf-period-bar-percentage {
  text-align: right;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
}

/* Responsive adjustments for period stats */
@media (max-width: 600px) {
  .tdf-period-stats {
    grid-template-columns: 1fr;
  }

  .tdf-period-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }

  .tdf-period-stat-label {
    margin-bottom: 0;
  }
}

/* Progress Row - Side by Side Cards */
.tdf-progress-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .tdf-progress-row {
    grid-template-columns: 1fr;
  }
}

/* Chart Card Styles */
.tdf-chart-card::before {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.tdf-chart-container {
  position: relative;
  height: 200px;
  padding: 10px 0 30px 0;
}

.tdf-chart-target-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 2;
  opacity: 0.7;
}

.tdf-chart-target-line::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 2px dashed #ef4444;
}

.tdf-chart-target-label {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 0.7rem;
  color: #ef4444;
  font-weight: 600;
  background: white;
  padding: 0 4px;
}

.tdf-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100%;
  gap: 4px;
  padding: 0 5px;
}

.tdf-chart-bar {
  flex: 1;
  max-width: 40px;
  min-width: 20px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  position: relative;
  cursor: pointer;
}

.tdf-chart-bar:hover {
  opacity: 0.85;
}

.tdf-bar-none {
  background: #e2e8f0;
}

.tdf-bar-under {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.tdf-bar-on {
  background: linear-gradient(180deg, #4ade80, #22c55e);
}

.tdf-bar-over {
  background: linear-gradient(180deg, #f87171, #ef4444);
}

.tdf-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  display: none;
}

.tdf-chart-bar:hover .tdf-bar-value {
  display: block;
}

.tdf-chart-labels {
  display: flex;
  justify-content: space-around;
  padding: 8px 5px 0;
  gap: 4px;
}

.tdf-chart-label {
  flex: 1;
  max-width: 40px;
  min-width: 20px;
  text-align: center;
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
}

.tdf-chart-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.tdf-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #64748b;
}

.tdf-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.tdf-legend-under .tdf-legend-dot {
  background: #f59e0b;
}

.tdf-legend-on .tdf-legend-dot {
  background: #22c55e;
}

.tdf-legend-over .tdf-legend-dot {
  background: #ef4444;
}

.tdf-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Progress Card */
.tdf-progress-display {
  text-align: center;
}

.tdf-progress-circle {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-radius: 50%;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.tdf-progress-value {
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.tdf-consumed-calories,
.tdf-target-calories {
  font-size: 2rem;
  font-weight: 800;
}

.tdf-divider {
  font-size: 1.5rem;
  opacity: 0.7;
}

.tdf-progress-value small {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tdf-macros-display {
  display: grid;
  gap: 0.75rem;
}

.tdf-macro-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 10px;
  border-left: 4px solid #22c55e;
}

.tdf-macro-item:nth-child(1) {
  border-left-color: #ef4444;
}

.tdf-macro-item:nth-child(2) {
  border-left-color: #f59e0b;
}

.tdf-macro-item:nth-child(3) {
  border-left-color: #3b82f6;
}

.tdf-macro-label {
  font-weight: 600;
  color: #475569;
}

.tdf-macro-value {
  font-weight: 700;
  color: #1e293b;
}

/* Quick Actions */
.tdf-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Buttons */
.tdf-btn {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.tdf-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tdf-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.tdf-btn-secondary {
  background: white;
  color: #2563eb;
  border-color: #2563eb;
}

.tdf-btn-secondary:hover {
  background: #2563eb;
  color: white;
}

.tdf-btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* 7-Day Meal Plan View */
.tdf-meal-plan-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tdf-day-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
}

.tdf-day-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.tdf-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.tdf-day-calories {
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.tdf-day-calories .tdf-day-total {
  font-weight: 700;
}

.tdf-day-calories .tdf-day-separator {
  margin: 0 0.25rem;
  opacity: 0.5;
}

.tdf-day-calories .tdf-day-target {
  opacity: 0.7;
}

.tdf-calories-on-target {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.tdf-calories-under {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.tdf-calories-over {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.tdf-day-macros {
  display: flex;
  gap: 1rem;
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.tdf-day-macros span {
  font-weight: 500;
}

.tdf-meal-section {
  margin-bottom: 1.5rem;
}

.tdf-meal-section h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #64748b;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tdf-meal-item {
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.tdf-meal-item-name {
  font-weight: 600;
  color: #1e293b;
  display: block;
  margin-bottom: 0.25rem;
}

.tdf-meal-item-details {
  font-size: 0.875rem;
  color: #64748b;
}

/* Meal Logging */
.tdf-meal-type-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e2e8f0;
}

.tdf-meal-type-section h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1rem 0;
}

/* Supplements section styling in Log Meals */
.tdf-meal-type-section.tdf-supplements-section {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border-color: #fde047;
}

.tdf-meal-type-section.tdf-supplements-section h4 {
  color: #854d0e;
}

.tdf-logged-items {
  margin-bottom: 1rem;
}

.tdf-logged-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.tdf-logged-item-details {
  flex: 1;
}

.tdf-logged-item-name {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.tdf-logged-item-nutrition {
  font-size: 0.875rem;
  color: #64748b;
}

.tdf-logged-item-delete {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

/* Supplements List */
.tdf-supplements-list {
  display: grid;
  gap: 1rem;
}

.tdf-supplement-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tdf-supplement-info {
  flex: 1;
}

.tdf-supplement-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.tdf-supplement-dosage {
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 0.5rem;
}

.tdf-supplement-timing {
  font-size: 0.875rem;
  color: #64748b;
}

.tdf-supplement-remove {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Modal Styles */
.tdf-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.tdf-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tdf-modal-content {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.tdf-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tdf-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.tdf-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 1;
}

.tdf-modal-body {
  padding: 2rem;
}

.tdf-modal-footer {
  padding: 1rem 2rem;
  border-top: 2px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.tdf-modal-small .tdf-modal-content,
.tdf-modal-content.tdf-modal-small {
  max-width: 400px;
}

/* Copy Day Modal Styles */
.tdf-copy-day-info {
  color: #64748b;
  margin-bottom: 1rem;
}

.tdf-copy-day-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tdf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-checkbox-label:hover {
  background: #f0fdf4;
}

.tdf-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.tdf-checkbox-label input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tdf-checkbox-label input[type="checkbox"]:disabled + span,
.tdf-checkbox-label:has(input:disabled) {
  opacity: 0.5;
}

.tdf-copy-day-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tdf-copy-day-actions .tdf-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

/* Form Styles */
.tdf-form-group {
  margin-bottom: 1.5rem;
}

.tdf-form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.tdf-input,
.tdf-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
}

.tdf-input:focus,
.tdf-textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.tdf-input-small {
  width: auto;
  min-width: 120px;
}

/* Date Picker */
.tdf-date-picker {
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
}

/* Loading State */
.tdf-loading {
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

/* Profile Summary Card */
.tdf-profile-summary-card {
  background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
}

.tdf-profile-summary-card::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.tdf-profile-greeting {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.tdf-user-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0e7490;
}

.tdf-profile-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tdf-target-item {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tdf-target-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tdf-target-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0891b2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.375rem;
}

.tdf-target-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #164e63;
}

.tdf-edit-profile-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  border: none;
}

.tdf-edit-profile-btn:hover {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  color: white;
}

.tdf-no-profile-msg {
  color: #64748b;
  margin-bottom: 1rem;
  text-align: center;
}

/* ================================
   CREATE PLAN VIEW STYLES
   ================================ */

/* View Header */
.tdf-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tdf-view-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

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

.tdf-back-to-dashboard {
  padding: 0.5rem 1rem;
}

.tdf-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tdf-log-info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  color: #1e40af;
  font-size: 0.9rem;
}

.tdf-save-daily-log-btn {
  white-space: nowrap;
}

/* Log Modal Filter */
.tdf-log-filter-section {
  margin-bottom: 1rem;
}

.tdf-log-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tdf-log-category-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.tdf-log-category-btn:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.tdf-log-category-btn.active {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border-color: transparent;
}

.tdf-log-menu-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
  background: #f8fafc;
  border-radius: 8px;
}

.tdf-modal-large {
  max-width: 700px;
}

/* Food Result Items (Log Meals modal) */
.tdf-food-result-item {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-food-result-item:hover {
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  transform: translateY(-2px);
}

.tdf-food-result-name {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.tdf-food-result-nutrition {
  font-size: 0.8rem;
  color: #64748b;
}

.tdf-no-items,
.tdf-loading {
  text-align: center;
  color: #64748b;
  padding: 2rem;
  grid-column: 1 / -1;
}

.tdf-error {
  text-align: center;
  color: #dc2626;
  padding: 2rem;
}

/* ========================================
   MEAL PLANS LIST VIEW
   ======================================== */

.tdf-meal-plans-list {
  margin-top: 1.5rem;
}

.tdf-no-plans-message {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
}

.tdf-no-plans-message p {
  color: #64748b;
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.tdf-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tdf-plan-card {
  background: white;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.2s;
}

.tdf-plan-card:hover {
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.tdf-plan-card-active {
  border-color: #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.tdf-plan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.tdf-plan-card-header h4 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
}

.tdf-active-badge {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tdf-plan-card-body {
  padding: 1rem 1.25rem;
}

.tdf-plan-items-count {
  margin: 0 0 0.5rem 0;
  color: #475569;
  font-weight: 600;
}

.tdf-plan-updated {
  margin: 0;
  color: #94a3b8;
  font-size: 0.875rem;
}

.tdf-plan-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fafafa;
}

.tdf-btn-danger {
  background: white;
  color: #dc2626;
  border-color: #dc2626;
}

.tdf-btn-danger:hover {
  background: #dc2626;
  color: white;
}

/* Plan Name Section */
.tdf-plan-name-section {
  margin-bottom: 1.5rem;
}

.tdf-plan-name-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #475569;
}

.tdf-plan-name-section .tdf-input {
  font-size: 1.125rem;
  font-weight: 600;
  max-width: 400px;
}

.tdf-plan-name-error {
  font-size: 0.875rem;
}

/* Day Tabs */
.tdf-day-tabs-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tdf-day-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tdf-copy-day-btn {
  white-space: nowrap;
}

.tdf-day-tab {
  padding: 0.75rem 1.25rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-day-tab:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.tdf-day-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border-color: #2563eb;
}

/* Daily Nutrition Summary */
.tdf-daily-nutrition-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 12px;
  flex-wrap: wrap;
}

.tdf-nutrition-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 0.5rem;
}

.tdf-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #166534;
}

.tdf-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Meal Builder Content */
.tdf-meal-builder-content {
  display: grid;
  gap: 1rem;
}

/* Meal Slots */
.tdf-meal-slot {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.tdf-supplements-slot {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border-color: #fde047;
}

.tdf-supplements-slot .tdf-meal-slot-header {
  border-bottom-color: #fde047;
}

.tdf-supplements-slot .tdf-meal-slot-header h4 {
  color: #854d0e;
}

.tdf-meal-slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f1f5f9;
}

.tdf-meal-slot-header h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.tdf-meal-slot-items {
  min-height: 60px;
}

.tdf-empty-slot {
  color: #94a3b8;
  font-style: italic;
  margin: 0;
  padding: 1rem;
  text-align: center;
  background: #f8fafc;
  border-radius: 8px;
  border: 2px dashed #e2e8f0;
}

/* Plan Items */
.tdf-plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border-left: 4px solid #22c55e;
}

.tdf-plan-item-info {
  flex: 1;
}

.tdf-plan-item-name {
  display: block;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.tdf-plan-item-nutrition {
  font-size: 0.8125rem;
  color: #64748b;
}

.tdf-remove-plan-item {
  background: #ef4444;
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tdf-remove-plan-item:hover {
  background: #dc2626;
}

/* Menu Item Modal - Large */
.tdf-modal-large {
  max-width: 900px;
  max-height: 85vh;
}

/* Menu Filter Section */
.tdf-menu-filter-section {
  margin-bottom: 1.5rem;
}

.tdf-category-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tdf-category-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-category-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.tdf-category-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Menu Items Grid */
.tdf-menu-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.tdf-menu-item-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tdf-menu-item-card:hover {
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
  transform: translateY(-2px);
}

.tdf-menu-item-name {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.tdf-menu-item-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
}

.tdf-menu-item-nutrition {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.tdf-menu-item-serving {
  font-size: 0.75rem;
  color: #94a3b8;
}

.tdf-no-items {
  grid-column: 1 / -1;
  text-align: center;
  color: #64748b;
  padding: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tdf-diet-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tdf-diet-nav {
    width: 100%;
  }

  .tdf-nav-btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  .tdf-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .tdf-meal-plan-content {
    grid-template-columns: 1fr;
  }

  .tdf-progress-circle {
    width: 150px;
    height: 150px;
  }

  .tdf-consumed-calories,
  .tdf-target-calories {
    font-size: 1.5rem;
  }

  .tdf-profile-targets {
    grid-template-columns: 1fr;
  }

  .tdf-user-name {
    font-size: 1.25rem;
  }

  .tdf-day-tabs {
    justify-content: center;
  }

  .tdf-day-tab {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
  }

  .tdf-daily-nutrition-summary {
    justify-content: center;
  }

  .tdf-nutrition-stat {
    min-width: 70px;
  }

  .tdf-stat-value {
    font-size: 1.25rem;
  }

  .tdf-menu-items-grid {
    grid-template-columns: 1fr;
  }
}
