/* Custom Styles for Asian Recipe Selector */

:root {
  --deep-red: #C41E3A;
  --gold: #FFD700;
  --jade-green: #00A86B;
  --charcoal: #36454F;
  --warm-white: #FAF9F6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--charcoal);
  background: linear-gradient(135deg, #FAF9F6 0%, #F5F5F5 100%);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--deep-red) 0%, #8B0020 100%);
  color: white;
  padding: 3rem 1rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.95;
  font-weight: 300;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  max-width: 1400px;
  margin: -2rem auto 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nav-tab {
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.nav-tab:hover:not(:disabled) {
  background: #f8f8f8;
  border-color: var(--jade-green);
  transform: translateY(-2px);
}

.nav-tab.active {
  background: var(--jade-green);
  color: white;
  border-color: var(--jade-green);
}

.nav-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-badge {
  background: #e0e0e0;
  color: var(--charcoal);
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

.nav-tab.active .tab-badge,
.tab-badge.badge-primary {
  background: var(--deep-red);
  color: white;
}

/* Filter Bar */
.filter-bar {
  background: white;
  padding: 1.5rem;
  margin: 0 auto 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  max-width: 1400px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal);
}

.filter-select,
.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.filter-select:hover,
.filter-input:hover,
.filter-select:focus,
.filter-input:focus {
  border-color: var(--jade-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

/* Recipe Grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Recipe Card */
.recipe-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.recipe-card.selected {
  border: 3px solid var(--jade-green);
  box-shadow: 0 8px 24px rgba(0, 168, 107, 0.2);
}

.recipe-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
  overflow: hidden;
  position: relative;
}

.recipe-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.recipe-card:hover .recipe-image img {
  transform: scale(1.05);
}

.recipe-content {
  padding: 1.5rem;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.recipe-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.25rem;
}

.cuisine-badge {
  background: var(--deep-red);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.recipe-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

.stat-icon {
  color: var(--jade-green);
}

.nutrition-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8f8f8;
  border-radius: 8px;
}

.nutrition-item {
  flex: 1;
  text-align: center;
}

.nutrition-label {
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.nutrition-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--charcoal);
}

.satiety-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.satiety-stars {
  display: flex;
  gap: 0.25rem;
}

.star {
  color: #ddd;
  font-size: 1rem;
}

.star.filled {
  color: var(--gold);
}

.recipe-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  text-align: center;
}

.btn-primary {
  background: var(--jade-green);
  color: white;
}

.btn-primary:hover {
  background: #00915C;
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--charcoal);
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #f8f8f8;
  border-color: var(--jade-green);
}

.btn-selected {
  background: var(--deep-red);
  color: white;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.modal-close:hover {
  background: #f8f8f8;
}

.recipe-detail {
  padding: 0;
}

.recipe-detail-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
  position: relative;
}

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

.recipe-detail-header,
.ingredients-section,
.instructions-section {
  padding: 0 2rem;
}

.recipe-detail-header {
  padding-top: 2rem;
}

.recipe-detail-header {
  margin-bottom: 2rem;
}

.recipe-detail-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.recipe-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ingredients-section,
.instructions-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--deep-red);
}

.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}

.ingredient-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f8f8f8;
  border-radius: 6px;
}

.ingredient-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.instructions-list {
  counter-reset: step-counter;
}

.instruction-step {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.instruction-step::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--jade-green);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* My Menu Section */
.menu-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 1400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.menu-title {
  font-size: 1.75rem;
  color: var(--charcoal);
}

.menu-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.menu-stat {
  text-align: center;
}

.menu-stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--jade-green);
}

.menu-stat-label {
  font-size: 0.875rem;
  color: #666;
}

.selected-recipes {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.selected-recipe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.selected-recipe-item:hover {
  background: #f0f0f0;
}

.recipe-info {
  flex: 1;
}

.recipe-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.recipe-details {
  font-size: 0.875rem;
  color: #666;
}

.serving-adjuster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.serving-btn {
  background: white;
  border: 1px solid #ddd;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.serving-btn:hover {
  background: #f8f8f8;
  border-color: var(--jade-green);
}

.serving-count {
  min-width: 40px;
  text-align: center;
  font-weight: 500;
}

/* Shopping List */
.shopping-list {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 1400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nutrition-summary {
  background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.nutrition-summary h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--charcoal);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.nutrition-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nutrition-card i {
  font-size: 1.5rem;
  color: var(--jade-green);
  margin-bottom: 0.5rem;
}

.nutrition-card .nutrition-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.25rem;
}

.nutrition-card .nutrition-label {
  font-size: 0.875rem;
  color: #666;
  text-transform: uppercase;
}

.shopping-category {
  margin-bottom: 2rem;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--deep-red);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.shopping-items {
  display: grid;
  gap: 0.75rem;
}

.shopping-item {
  display: flex;
  align-items: start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8f8f8;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.shopping-item:hover {
  background: #f0f0f0;
}

.shopping-item.checked {
  opacity: 0.6;
  text-decoration: line-through;
}

.item-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.item-quantity {
  color: var(--jade-green);
  font-weight: 600;
}

.item-recipes {
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.25rem;
}

/* Export Options */
.export-options {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #f0f0f0;
}



/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .recipe-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .recipe-stats {
    grid-template-columns: 1fr;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .modal-content {
    max-height: 100vh;
    border-radius: 0;
  }
  
  .menu-header {
    flex-direction: column;
    gap: 1rem;
    align-items: start;
  }
}

@media (max-width: 1024px) {
  .recipe-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
}

.loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--jade-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    font-size: 12pt;
  }
  
  .hero-section,
  .nav-tabs,
  .filter-bar,
  .btn,
  .modal-close,
  .serving-adjuster,
  .export-options,
  input[type="checkbox"] {
    display: none !important;
  }
  
  .recipe-card {
    break-inside: avoid;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
  }
  
  .shopping-list {
    padding: 0;
    box-shadow: none;
  }
  
  .shopping-category {
    page-break-inside: avoid;
  }
  
  .shopping-item {
    page-break-inside: avoid;
  }
  
  h2 {
    font-size: 18pt;
    margin-bottom: 1rem;
  }
  
  .category-title {
    font-size: 14pt;
    margin-top: 1rem;
  }
}