/* ── Mobile AI Composition (/compose) ── */

/* ── Form Layout ───────────────────────────── */
.compose-form-section {
  padding: 0 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.form-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(201,169,110,0.7);
}

/* Brief textarea */
.compose-brief-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.9rem 1rem;
  background: rgba(201,169,110,0.03);
  border: 1.5px solid rgba(201,169,110,0.15);
  border-radius: 14px;
  color: var(--fg-primary);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.compose-brief-textarea:focus {
  outline: none;
  border-color: rgba(201,169,110,0.45);
}
.compose-brief-textarea::placeholder { color: rgba(242,234,216,0.3); }
.char-count {
  font-size: 0.72rem;
  color: rgba(242,234,216,0.3);
  text-align: right;
  margin-top: -0.25rem;
}

/* Mood emoji picker */
.mood-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.mood-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.4rem;
  background: rgba(201,169,110,0.03);
  border: 1.5px solid rgba(201,169,110,0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 64px;
  font-size: 0;
}
.mood-chip .mood-emoji { font-size: 1.4rem; line-height: 1; }
.mood-chip .mood-label {
  font-family: var(--sans);
  font-size: 0.6rem;
  color: rgba(242,234,216,0.45);
  text-align: center;
  line-height: 1.2;
}
.mood-chip:hover {
  background: rgba(201,169,110,0.06);
  border-color: rgba(201,169,110,0.3);
}
.mood-chip.selected {
  background: rgba(201,169,110,0.1);
  border-color: rgba(201,169,110,0.5);
}
.mood-chip.selected .mood-label { color: var(--accent-gold); }
.mood-chip input[type="checkbox"] { display: none; }

/* Selects and dropdowns */
.compose-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(201,169,110,0.03);
  border: 1.5px solid rgba(201,169,110,0.15);
  border-radius: 12px;
  color: var(--fg-primary);
  font-family: var(--sans);
  font-size: 0.9rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c9a96e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  transition: border-color 0.2s;
}
.compose-select:focus { outline: none; border-color: rgba(201,169,110,0.45); }
.compose-select option { background: #1a150d; }

/* Dietary checklist */
.dietary-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.diet-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  background: rgba(201,169,110,0.02);
  border: 1.5px solid rgba(201,169,110,0.1);
  border-radius: 100px;
  cursor: pointer;
  font-size: 0.78rem;
  color: rgba(242,234,216,0.6);
  transition: all 0.18s ease;
  user-select: none;
}
.diet-chip:hover { border-color: rgba(201,169,110,0.3); color: var(--fg-primary); }
.diet-chip.selected {
  background: rgba(201,169,110,0.08);
  border-color: rgba(201,169,110,0.4);
  color: var(--accent-gold);
}
.diet-chip input { display: none; }

/* Generate CTA button */
.compose-cta-btn {
  width: 100%;
  min-height: 52px;
  background: linear-gradient(135deg, #c9a96e 0%, #a07830 100%);
  color: #0a0a0a;
  border: none;
  border-radius: 14px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(201,169,110,0.25);
}
.compose-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(201,169,110,0.35); }
.compose-cta-btn:active { transform: translateY(0); }
.compose-cta-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.compose-cta-btn .btn-spinner {
  width: 18px; height: 18px;
  animation: gustatory-loader-pulse 1.2s ease-in-out infinite;
  display: none;
}

@keyframes gustatory-loader-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50%       { transform: scale(1.08); opacity: 1; }
}
.compose-cta-btn.loading .btn-spinner { display: block; }

/* Loading state */
.compose-loading-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
}
.compose-loading-overlay.active { display: flex; }
.pulse-rings {
  position: relative;
  width: 80px;
  height: 80px;
}
.pulse-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(201,169,110,0.3);
  border-radius: 50%;
  animation: pulseOut 1.5s ease-out infinite;
}
.pulse-ring:nth-child(2) { animation-delay: 0.4s; }
.pulse-ring:nth-child(3) { animation-delay: 0.8s; }
.pulse-core {
  position: absolute;
  inset: 20px;
  background: rgba(201,169,110,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pulse-core svg { color: #c9a96e; }
@keyframes pulseOut {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.compose-loading-text {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--fg-muted);
}
.compose-loading-sub {
  font-size: 0.8rem;
  color: rgba(242,234,216,0.35);
  margin-top: -0.75rem;
}

/* Results card */
.compose-result-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid rgba(201,169,110,0.15);
  border-radius: 20px;
  overflow: hidden;
  margin: 0 1.25rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.compose-result-card.active { display: block; animation: fadeSlideUp 0.5s ease-out; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  background: linear-gradient(135deg, rgba(201,169,110,0.12) 0%, rgba(139,105,20,0.08) 100%);
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(201,169,110,0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.result-dish-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg-primary);
  line-height: 1.2;
}
.result-dish-narrative {
  font-size: 0.82rem;
  color: rgba(242,234,216,0.5);
  margin-top: 0.35rem;
  line-height: 1.5;
  font-style: italic;
}
.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.result-action-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-gold);
  transition: all 0.18s;
}
.result-action-btn:hover { background: rgba(201,169,110,0.2); }
.result-action-btn.saved { background: rgba(201,169,110,0.3); }

.result-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }

.result-section-title {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(201,169,110,0.5);
  margin-bottom: 0.6rem;
}

.result-ingredients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.result-ingredient-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: rgba(201,169,110,0.03);
  border: 1px solid rgba(201,169,110,0.1);
  border-radius: 10px;
  font-size: 0.8rem;
}
.result-ingredient-chip .role-badge {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(201,169,110,0.15);
  color: var(--accent-gold);
  font-weight: 600;
}

.result-techniques-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.result-technique-tag {
  padding: 0.3rem 0.7rem;
  background: rgba(139,105,20,0.12);
  border: 1px solid rgba(201,169,110,0.18);
  border-radius: 8px;
  font-size: 0.75rem;
  color: rgba(242,234,216,0.7);
}

.result-texture-flow {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem;
  background: rgba(201,169,110,0.02);
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.texture-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 48px;
  animation: fadeIn 0.3s ease-out both;
}
.texture-step-num {
  font-size: 0.6rem;
  color: rgba(201,169,110,0.4);
}
.texture-step-name {
  font-size: 0.7rem;
  color: rgba(242,234,216,0.7);
  text-align: center;
  line-height: 1.2;
}
.texture-step-arrow {
  color: rgba(201,169,110,0.3);
  font-size: 0.8rem;
  flex-shrink: 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-beverages {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.result-beverage-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: rgba(201,169,110,0.02);
  border: 1px solid rgba(201,169,110,0.08);
  border-radius: 10px;
  font-size: 0.82rem;
}
.result-beverage-item .bev-icon { color: var(--accent-gold); flex-shrink: 0; }
.result-beverage-item .bev-name { color: var(--fg-primary); font-weight: 500; }
.result-beverage-item .bev-reason { color: rgba(242,234,216,0.4); font-size: 0.75rem; }

.result-cultural {
  padding: 0.85rem 1rem;
  background: rgba(201,169,110,0.04);
  border: 1px solid rgba(201,169,110,0.1);
  border-radius: 12px;
  font-size: 0.8rem;
  color: rgba(242,234,216,0.6);
  line-height: 1.6;
  font-style: italic;
}

.result-share-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(201,169,110,0.06);
}
.share-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  border: none;
  font-family: var(--sans);
}
.share-btn.save {
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.25);
  color: var(--accent-gold);
}
.share-btn.save:hover { background: rgba(201,169,110,0.18); }
.share-btn.save.saved { background: rgba(201,169,110,0.2); }
.share-btn.share {
  background: rgba(201,169,110,0.04);
  border: 1px solid rgba(201,169,110,0.1);
  color: rgba(242,234,216,0.6);
}
.share-btn.share:hover { background: rgba(201,169,110,0.08); }

/* Quota limit modal */
.quota-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1rem;
}
.quota-modal.active { display: flex; animation: fadeIn 0.2s ease; }
.quota-modal-content {
  background: #161615;
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 20px 20px 0 0;
  padding: 2rem 1.5rem 2.5rem;
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.quota-modal-icon { margin-bottom: 1rem; color: var(--accent-gold); }
.quota-modal-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--fg-primary);
  margin-bottom: 0.5rem;
}
.quota-modal-desc { font-size: 0.85rem; color: rgba(242,234,216,0.5); margin-bottom: 1.5rem; }
.quota-modal-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.quota-upgrade-btn {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #c9a96e, #a07830);
  color: #0a0a0a;
  border: none;
  border-radius: 12px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.quota-later-btn {
  background: none;
  border: none;
  color: rgba(242,234,216,0.4);
  font-family: var(--sans);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ── Mobile Responsive ── */
@media (max-width: 480px) {
  .compose-form-section { padding: 0 1rem 2rem; }
  .mood-picker-grid { grid-template-columns: repeat(3, 1fr); }
  .mood-chip { min-height: 60px; }
  .mood-chip .mood-emoji { font-size: 1.2rem; }
  .compose-result-card { margin: 0 1rem 1.5rem; }
  .result-ingredients-grid { grid-template-columns: 1fr; }
  .quota-bar { padding: 0.4rem 1rem; }
}

@media (max-width: 375px) {
  .mood-picker-grid { grid-template-columns: repeat(2, 1fr); }
}