/* Recipe Detail Page Specific Styles */

/* Hero Section Enhancements */
.recipe-hero {
  position: relative;
  overflow: hidden;
}

.recipe-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(138, 0, 0, 0.3),
    rgba(133, 49, 0, 0.2)
  );
  z-index: 1;
}

.recipe-hero .container {
  position: relative;
  z-index: 2;
}

/* Recipe Card Animations */
.recipe-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.recipe-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.recipe-card:hover::before {
  left: 100%;
}

/* Instruction Steps */
.instruction-step {
  transition: all 0.3s ease;
  position: relative;
}

.instruction-step:hover {
  transform: translateX(8px);
}

.instruction-step .step-number {
  transition: all 0.3s ease;
}

.instruction-step:hover .step-number {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(138, 0, 0, 0.3);
}

/* Ingredients List */
.ingredient-item {
  transition: all 0.2s ease;
  position: relative;
}

.ingredient-item:hover {
  background-color: rgba(138, 0, 0, 0.05);
  transform: translateX(4px);
}

.ingredient-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--primary);
  transition: width 0.3s ease;
}

.ingredient-item:hover::before {
  width: 4px;
}

/* Sidebar Sticky */
.sidebar-sticky {
  position: sticky;
  top: 2rem;
}

/* Action Buttons */
.action-button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.action-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.action-button:hover::before {
  left: 100%;
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 0, 0, 0.3);
}

/* Rating Stars */
.rating-star {
  transition: all 0.2s ease;
  cursor: pointer;
}

.rating-star:hover {
  transform: scale(1.2);
}

.rating-star.active {
  color: #fbbf24;
}

/* Comment Cards */
.comment-card {
  transition: all 0.3s ease;
  position: relative;
}

.comment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.comment-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.comment-card:hover::before {
  opacity: 1;
}

/* Nutrition Facts */
.nutrition-item {
  transition: all 0.2s ease;
}

.nutrition-item:hover {
  background-color: rgba(138, 0, 0, 0.05);
  transform: translateX(4px);
}

/* Related Recipe Cards */
.related-recipe {
  transition: all 0.3s ease;
  cursor: pointer;
}

.related-recipe:hover {
  transform: translateY(-4px);
}

.related-recipe img {
  transition: transform 0.3s ease;
}

.related-recipe:hover img {
  transform: scale(1.05);
}

/* Form Enhancements */
.form-input {
  transition: all 0.3s ease;
}

.form-input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(138, 0, 0, 0.1);
}

/* Loading Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered Animation */
.fade-in-up:nth-child(1) {
  animation-delay: 0.1s;
}
.fade-in-up:nth-child(2) {
  animation-delay: 0.2s;
}
.fade-in-up:nth-child(3) {
  animation-delay: 0.3s;
}
.fade-in-up:nth-child(4) {
  animation-delay: 0.4s;
}
.fade-in-up:nth-child(5) {
  animation-delay: 0.5s;
}
.fade-in-up:nth-child(6) {
  animation-delay: 0.6s;
}

/* Print Styles */
@media print {
  .recipe-hero {
    height: auto;
    background: white !important;
  }

  .recipe-hero::before {
    display: none;
  }

  .recipe-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .action-button {
    display: none;
  }

  .sidebar-sticky {
    position: static;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .recipe-card {
    background: #1f2937;
    border: 1px solid #374151;
  }

  .recipe-card:hover {
    background: #111827;
    border-color: var(--sqube-red);
  }

  .ingredient-item:hover {
    background-color: rgba(138, 0, 0, 0.1);
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .recipe-hero {
    height: 50vh;
  }

  .recipe-hero h1 {
    font-size: 2.5rem;
  }

  .instruction-step {
    flex-direction: column;
    gap: 1rem;
  }

  .instruction-step .step-number {
    align-self: flex-start;
  }

  .sidebar-sticky {
    position: static;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .recipe-card {
    border: 2px solid var(--sqube-red);
  }

  .instruction-step .step-number {
    border: 2px solid var(--sqube-red);
  }

  .action-button {
    border: 2px solid var(--sqube-red);
  }
}
