/*
  ================================================================================
  RecipeCreator - Main Stylesheet
  Version: 3.7
  Description: Added styles for the new dietary search filters on the blog page.
  ================================================================================
*/

:root {
  --primary-color: #00ffd7;
  --secondary-color: #ff52f7;
  --background-dark: #0e162a;
  --background-light: #1c2a4c;
  --text-color: #e0e6f0;
  --text-muted: #a0b0c0;
  --font-body: 'Roboto', sans-serif;
  --font-display: 'Orbitron', sans-serif;
  --border-radius: 12px;
  --box-shadow: 0 6px 24px rgba(0, 255, 215, 0.1), 0 2px 8px rgba(0, 255, 215, 0.1);
}

/* --- Base & Typography --- */
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--background-dark);
  color: var(--text-color);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--primary-color);
  margin-top: 0;
  letter-spacing: 1px;
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: var(--secondary-color);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary-color);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
}

/* --- SVG Icons --- */
.svg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  margin-right: 0.5em;
}

/* --- Layout & Containers --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.main-content {
  padding-top: 2rem;
}

/* --- Header & Navigation --- */
.site-header {
  background: var(--background-light);
  padding: 1rem 0;
  border-bottom: 2px solid var(--primary-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--primary-color);
  gap: 0.5rem;
}

.main-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.main-nav a {
  font-weight: 700;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover, .main-nav a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 4rem 1rem;
  background: linear-gradient(135deg, rgba(14, 22, 42, 0.8), rgba(28, 42, 76, 0.8)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%2300ffd7' fill-opacity='0.1'%3E%3Crect x='0' y='0' width='50' height='50'/%3E%3Crect x='50' y='50' width='50' height='50'/%3E%3C/g%3E%3C/svg%3E");
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

/* --- Recipe Generation Card --- */
.generator-card {
  background: var(--background-light);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--primary-color);
  max-width: 650px;
  margin: -2rem auto 3rem auto;
  position: relative;
  z-index: 10;
}

.form-step {
  margin-bottom: 2rem;
}

.form-step h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--secondary-color);
  font-size: 1.4rem;
  border-bottom: 1px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid #3a4a6a;
  background: var(--background-dark);
  color: var(--text-color);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 255, 215, 0.2);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.cuisine-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.cuisine-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.2s, color 0.2s;
}

.cuisine-btn:hover, .cuisine-btn.selected {
  background: var(--primary-color);
  color: var(--background-dark);
}

.ingredient-mode {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* --- Recipe Options Toggles --- */
.recipe-options-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: center;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch .slider {
    width: 44px;
    height: 24px;
    background-color: #3a4a6a;
    border-radius: 12px;
    position: relative;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.toggle-switch .slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.toggle-switch label {
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
}


/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 8px;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  color: var(--background-dark);
  box-shadow: 0 4px 15px rgba(255, 82, 247, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 82, 247, 0.3);
}

.btn-secondary {
  background: var(--background-light);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: var(--background-dark);
}

.generator-card .btn-primary {
  width: 100%;
  padding: 1rem;
  font-size: 1.3rem;
  margin-top: 1rem;
}

/* --- Recipe Cards --- */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.recipe-card {
  background: var(--background-light);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 255, 215, 0.15), 0 4px 12px rgba(0, 255, 215, 0.15);
}

.recipe-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 2px solid var(--primary-color);
}

.recipe-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.recipe-card-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.recipe-card-content h3 a {
  color: var(--primary-color);
}

.recipe-card-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.recipe-card-desc {
  font-size: 1rem;
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.share-button-group {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.share-button-group .btn {
    flex-grow: 1;
}

.share-button-group .btn-share {
    background-color: var(--secondary-color);
    color: white;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* --- Blog Page Search Filters --- */
#blog-search, #blog-cuisine {
    padding: 0.7rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #3a4a6a;
    background: var(--background-dark);
    color: var(--text-color);
    margin: 0 0.5rem;
}

.dietary-filter-container {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 1.5rem;
    background: rgba(28, 42, 76, 0.5);
    border-radius: var(--border-radius);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    justify-content: center;
    align-items: center;
    border: 1px solid #3a4a6a;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.filter-checkbox-label:hover {
    color: var(--text-color);
}

.filter-checkbox-label input {
    width: 1.2em;
    height: 1.2em;
    accent-color: var(--primary-color);
    cursor: pointer;
}


/* --- Modals & Progress Bar --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 22, 42, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: var(--background-light);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--primary-color);
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
}

.progress-bar-container {
    width: 100%;
    background-color: var(--background-dark);
    border-radius: 10px;
    border: 1px solid var(--primary-color);
    margin-top: 1rem;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 20px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    text-align: center;
    line-height: 20px;
    color: var(--background-dark);
    font-weight: bold;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

#modal-status-text {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-muted);
}

.junk-mail-notice {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 82, 247, 0.1);
    border-left: 4px solid var(--secondary-color);
    font-size: 0.95rem;
    text-align: left;
}

/* --- Individual Recipe Page --- */
.recipe-page-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.recipe-header h1 {
    color: var(--secondary-color);
    text-align: center;
}

.recipe-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-weight: bold;
}

.recipe-main-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    border: 2px solid var(--primary-color);
}

.recipe-section {
    margin-top: 2rem;
}

.recipe-section h2 {
    color: var(--primary-color);
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.recipe-section ul, .recipe-section ol {
    padding-left: 20px;
    line-height: 1.7;
}

.nutrition-list {
    list-style: none;
    padding: 0;
    column-count: 2;
    -webkit-column-count: 2;
    -moz-column-count: 2;
    gap: 1rem;
}

.nutrition-list li {
    margin-bottom: 0.5rem;
}

.share-section .share-button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.infusion-section {
    border: 2px solid var(--secondary-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    background-color: rgba(255, 82, 247, 0.05);
}


/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 1px solid #3a4a6a;
  color: var(--text-muted);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .generator-card {
    padding: 1.5rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .nutrition-list {
    column-count: 1;
    -webkit-column-count: 1;
    -moz-column-count: 1;
  }
}

@media (max-width: 480px) {
  .main-nav ul {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .recipe-options-group {
    grid-template-columns: 1fr;
  }
}