/* ================================
   Recipe Single Page Styles
   ================================ */

/* Recipe Meta Bar */
.recipe-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 0;
  margin: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.recipe-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--color-bg-alt, #f8f8f8);
  border-radius: 8px;
}

.recipe-meta-item .material-icons {
  font-size: 1.5rem;
  color: var(--color-accent);
}

.recipe-meta-content {
  display: flex;
  flex-direction: column;
}

.recipe-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.recipe-meta-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Difficulty Levels */
.difficulty-easy { color: #22c55e; }
.difficulty-medium { color: #f59e0b; }
.difficulty-hard { color: #ef4444; }

/* Cost Indicator */
.cost-indicator {
  font-weight: 700;
  color: var(--color-accent);
}

/* Rating Stars */
.recipe-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recipe-rating .stars {
  display: flex;
}

.recipe-rating .star-filled { color: #fbbf24; }
.recipe-rating .star-half { color: #fbbf24; }
.recipe-rating .star-empty { color: #d1d5db; }

.rating-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* Action Buttons */
.recipe-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: 50px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn-action .material-icons {
  font-size: 1.2rem;
}

.btn-action.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Recipe Hero Image */
.recipe-hero-wrapper {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.recipe-hero-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Recipe Card Sections */
.recipe-card-section {
  background: var(--color-bg);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--color-bg-alt, #f8f8f8);
  border-bottom: 1px solid var(--color-border);
}

.card-section-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-section-header h3 .material-icons {
  color: var(--color-accent);
}

.btn-clear-all {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-all:hover {
  background: var(--color-accent);
  color: white;
}

/* Progress Bar */
.progress-bar-container {
  position: relative;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  margin: 1rem 1.25rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light, #66bb6a));
  border-radius: 3px;
  width: 0;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Ingredients List */
.ingredients-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ingredient-item {
  border-bottom: 1px solid var(--color-border);
}

.ingredient-item:last-child {
  border-bottom: none;
}

.checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.checkbox-wrapper:hover {
  background: var(--color-bg-alt, #f8f8f8);
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkmark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-wrapper input:checked + .checkmark {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.checkbox-wrapper input:checked + .checkmark::after {
  content: '\e5ca';
  font-family: 'Material Icons';
  color: white;
  font-size: 14px;
}

.ingredient-text {
  flex: 1;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.checkbox-wrapper input:checked ~ .ingredient-text {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Equipment List */
.equipment-list {
  list-style: none;
  padding: 1rem 1.25rem;
  margin: 0;
}

.equipment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.equipment-item .material-icons {
  color: var(--color-accent);
  font-size: 1.2rem;
}

/* Nutrition Grid */
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-border);
}

.nutrition-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--color-bg);
  text-align: center;
}

.nutrition-item.main {
  grid-column: span 2;
  background: var(--color-bg-alt, #f8f8f8);
}

.nutrition-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.nutrition-item.main .nutrition-value {
  font-size: 1.75rem;
  color: var(--color-accent);
}

.nutrition-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.per-serving {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Instructions List */
.instructions-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.instruction-item {
  border-bottom: 1px solid var(--color-border);
}

.instruction-item:last-child {
  border-bottom: none;
}

.instruction-item .checkbox-wrapper {
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 1rem;
  transition: all 0.2s ease;
}

.instruction-item .checkbox-wrapper input:checked ~ .step-number {
  background: #22c55e;
}

.instruction-item .checkbox-wrapper input:checked ~ .step-number::after {
  content: '\e5ca';
  font-family: 'Material Icons';
}

.instruction-text {
  flex: 1;
  line-height: 1.6;
  padding-top: 0.25rem;
}

.instruction-item .checkbox-wrapper input:checked ~ .instruction-text {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Notes & Tips */
.notes-content,
.tips-list {
  padding: 1rem 1.25rem;
}

.notes-content p {
  margin: 0;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.tips-list {
  list-style: none;
  margin: 0;
}

.tips-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.tips-list li::before {
  content: '\e0f0';
  font-family: 'Material Icons';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: 1rem;
}

/* Storage Grid */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.storage-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: var(--color-bg-alt, #f8f8f8);
  border-radius: 12px;
}

.storage-item .material-icons {
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.storage-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.storage-value {
  font-weight: 600;
  color: var(--color-text);
}

/* Author Box */
.author-box {
  background: var(--color-bg-alt, #f8f8f8);
  border-radius: 16px;
  padding: 2rem;
}

.author-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.author-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
}

.author-name {
  margin: 0.25rem 0;
  font-size: 1.25rem;
}

.author-bio {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Related Recipes */
.related-recipes .section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Share Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--color-bg);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-alt, #f8f8f8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content h3 {
  margin: 0 0 1.5rem;
  text-align: center;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.pinterest { background: #e60023; }
.share-btn.email { background: #6b7280; }

.copy-link {
  display: flex;
  gap: 0.5rem;
}

.copy-link input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--color-bg-alt, #f8f8f8);
}

.btn-copy {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
  .recipe-meta-bar {
    gap: 0.5rem;
  }

  .recipe-meta-item {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 130px;
  }

  .author-content {
    flex-direction: column;
    text-align: center;
  }

  .storage-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================
   Recipe Cards Grid (Ingredients + Instructions)
   Full width, side-by-side layout
   ================================ */
.recipe-cards-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-bottom: 2rem;
}

.recipe-column-left,
.recipe-column-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.recipe-column-left .recipe-card-section,
.recipe-column-right .recipe-card-section {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .recipe-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ================================
   Recipe Page Layout with Sidebar
   ================================ */
.recipe-page-wrapper {
  max-width: 1400px;
}

.recipe-page-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.recipe-main-content {
  min-width: 0;
}

/* ================================
   Recipe Sidebar Styles
   ================================ */
.recipe-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: #fff;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 4px;
  overflow: hidden;
}

/* Sidebar Search */
.sidebar-search {
  padding: 0;
  border: 1px solid var(--color-text);
}

.sidebar-search-form {
  display: flex;
  align-items: center;
}

.sidebar-search-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sidebar-search-input::placeholder {
  color: var(--color-text-muted);
}

.sidebar-search-input:focus {
  outline: none;
}

.sidebar-search-btn {
  padding: 12px 16px;
  background: none;
  border: none;
  border-left: 1px solid var(--color-text);
  cursor: pointer;
  color: var(--color-text);
}

.sidebar-search-btn:hover {
  background: var(--color-bg-alt, #f8f8f8);
}

/* Sidebar Recipe Key */
.sidebar-recipe-key {
  padding: 20px;
}

.sidebar-widget-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-text);
}

.recipe-key-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-key-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.recipe-key-item .badge {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.recipe-key-item .badge-gf { background: #22c55e; }
.recipe-key-item .badge-vg { background: #ef4444; }
.recipe-key-item .badge-v { background: #f97316; }
.recipe-key-item .badge-df { background: #8b5cf6; }
.recipe-key-item .badge-ns { background: #06b6d4; }

.recipe-key-label {
  font-size: 14px;
  color: var(--color-text);
}

/* Sidebar Ad */
.sidebar-ad {
  padding: 0;
  background: #f8f8f8;
  text-align: center;
}

.sidebar-ad .ad-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 8px;
  background: #eee;
}

.sidebar-ad .ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e5e5e5;
  color: #999;
  font-size: 14px;
}

.sidebar-ad .ad-placeholder.ad-300x250 {
  height: 250px;
}

.sidebar-ad .ad-placeholder.ad-300x600 {
  height: 600px;
}

/* Sidebar Newsletter */
.sidebar-newsletter {
  padding: 24px 20px;
  background: linear-gradient(135deg, #ffeee6 0%, #fff5f0 100%);
  text-align: center;
}

.sidebar-newsletter-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.sidebar-newsletter-text {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.sidebar-newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-newsletter-input {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
}

.sidebar-newsletter-input::placeholder {
  color: var(--color-text-muted);
}

.sidebar-newsletter-btn {
  padding: 14px 20px;
  background: var(--color-text);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-newsletter-btn:hover {
  background: #444;
}

/* Sidebar Reader Favorites */
.sidebar-reader-favorites {
  background: var(--color-bg);
  padding: 20px;
}

.sidebar-favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--color-border, #e5e5e5);
}

.sidebar-favorites-stars {
  display: flex;
  gap: 2px;
}

.sidebar-favorites-stars svg {
  color: #e07b53;
}

.sidebar-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-favorites-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border, #eee);
  transition: opacity 0.2s ease;
}

.sidebar-favorites-item:last-child {
  border-bottom: none;
}

.sidebar-favorites-item:hover {
  opacity: 0.8;
}

.sidebar-favorites-image {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 4px;
}

.sidebar-favorites-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-favorites-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-bg-alt, #f5f5f5);
}

.sidebar-favorites-number {
  font-size: 24px;
  font-weight: 300;
  color: var(--color-text-muted);
  width: 35px;
  flex-shrink: 0;
}

.sidebar-favorites-content {
  flex: 1;
  min-width: 0;
}

.sidebar-favorites-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 6px 0;
  color: var(--color-text);
}

.sidebar-favorites-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sidebar-favorites-badges .badge {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

/* Sidebar Responsive */
@media (max-width: 1024px) {
  .recipe-page-layout {
    grid-template-columns: 1fr;
  }

  .recipe-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
  }

  .sidebar-newsletter {
    grid-column: span 2;
  }

  .sidebar-ad .ad-placeholder.ad-300x600 {
    height: 250px;
  }
}

@media (max-width: 640px) {
  .recipe-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar-newsletter {
    grid-column: span 1;
  }
}
