/* ═══════════════════════════════════════════
   RECIPES
═══════════════════════════════════════════ */

.recipes-container {
  padding: 16px;
  max-width: 700px;
  margin: 0 auto;
}

/* ── Empty state ── */
.recipes-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.recipes-empty__icon  { font-size: 48px; margin-bottom: 12px; }
.recipes-empty__title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.recipes-empty__sub   { font-size: 13px; line-height: 1.5; margin-bottom: 20px; }

/* ── Add button ── */
.recipes-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  background: var(--brand-primary, #7C4A9E); color: #fff;
  border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  margin-bottom: 20px;
  transition: opacity 150ms;
}
.recipes-add-btn:active { opacity: .85; }

/* ── Grid ── */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

/* ── Card ── */
.recipe-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 150ms, border-color 150ms;
}
.recipe-card:hover  { transform: translateY(-2px); border-color: var(--brand-primary); }
.recipe-card:active { transform: scale(.98); }
.recipe-card__img {
  width: 100%; height: 110px;
  background-size: cover; background-position: center;
  background-color: var(--bg-surface-2);
}
.recipe-card__img--placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.recipe-card__body { padding: 10px 12px 12px; }
.recipe-card__title {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  line-height: 1.3; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recipe-card__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 11px; color: var(--text-secondary);
}
.recipe-card__shared {
  background: var(--brand-primary); color: #fff;
  border-radius: 99px; padding: 1px 7px; font-weight: 700;
}

/* ── Add panel ── */
.recipe-add-panel__body {
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; max-height: 68vh;
}
.recipe-add-section { display: flex; flex-direction: column; gap: 6px; }
.recipe-add-label   { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.recipe-add-hint    { font-size: 12px; color: var(--text-secondary); margin: 0; }
.recipe-add-row     { display: flex; gap: 8px; }
.recipe-url-input {
  flex: 1; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg-surface-2); color: var(--text-primary);
  font-size: 14px; outline: none;
}
.recipe-url-input:focus { border-color: var(--brand-primary); }
.recipe-extract-btn { flex-shrink: 0; }
.recipe-photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 2px dashed var(--border); border-radius: 10px;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: border-color 150ms, color 150ms;
}
.recipe-photo-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.recipe-add-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-tertiary); font-size: 12px; margin: 2px 0;
}
.recipe-add-divider::before,
.recipe-add-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.recipe-add-status { padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.recipe-add-status--error   { background: rgba(239,68,68,.1); color: #dc2626; }
.recipe-add-status--success { background: rgba(34,197,94,.1);  color: #16a34a; }

/* ── Editor panel ── */
.recipe-editor-panel { max-height: 92vh; display: flex; flex-direction: column; }
.recipe-editor__body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.recipe-editor__img   { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; }
.recipe-editor__field { display: flex; flex-direction: column; gap: 6px; }
.recipe-editor__row2  { display: flex; gap: 12px; }
.recipe-editor__row2 .recipe-editor__field { flex: 1; }
.recipe-editor__section-hdr { display: flex; align-items: center; justify-content: space-between; }
.recipe-ing-add {
  font-size: 12px; font-weight: 700; color: var(--brand-primary);
  background: none; border: none; cursor: pointer; padding: 2px 4px;
}
.recipe-ing-list, .recipe-step-list { display: flex; flex-direction: column; gap: 6px; }
.recipe-ing-empty { font-size: 12px; color: var(--text-secondary); margin: 0; font-style: italic; }

.recipe-ing-row { display: flex; gap: 6px; align-items: center; }
.recipe-ing__qty  { width: 52px; flex-shrink: 0; }
.recipe-ing__unit { width: 52px; flex-shrink: 0; }
.recipe-ing__qty, .recipe-ing__unit, .recipe-ing__name {
  padding: 8px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg-surface-2); color: var(--text-primary); font-size: 13px; outline: none;
}
.recipe-ing__qty:focus,
.recipe-ing__unit:focus,
.recipe-ing__name:focus { border-color: var(--brand-primary); }

.recipe-row-del {
  background: none; border: none; color: var(--text-tertiary);
  font-size: 14px; cursor: pointer; padding: 4px 6px; flex-shrink: 0;
  transition: color 150ms;
}
.recipe-row-del:hover { color: #dc2626; }

.recipe-step-row { display: flex; gap: 8px; align-items: flex-start; }
.recipe-step__num {
  width: 22px; height: 22px; flex-shrink: 0; margin-top: 8px;
  background: var(--brand-primary); color: #fff;
  border-radius: 50%; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.recipe-step__text {
  flex: 1; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--bg-surface-2); color: var(--text-primary);
  font-size: 13px; resize: vertical; outline: none; line-height: 1.4;
}
.recipe-step__text:focus { border-color: var(--brand-primary); }

/* ── Detail panel ── */
.recipe-detail-panel { max-height: 92vh; display: flex; flex-direction: column; }
.recipe-detail__hero { width: 100%; height: 180px; background-size: cover; background-position: center; flex-shrink: 0; }
.recipe-detail__header { padding: 16px 20px 0; }
.recipe-detail__title  { font-size: 18px; font-weight: 900; color: var(--text-primary); margin: 0 0 6px; }
.recipe-detail__meta   { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.recipe-detail__src    { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
.recipe-detail__body   { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 20px; }
.recipe-detail__section h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin: 0 0 10px; }

.recipe-detail__ing-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.recipe-detail__ing {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: var(--bg-surface-2); border-radius: 8px;
}
.recipe-detail__ing-check { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; }
.recipe-detail__cb   { width: 16px; height: 16px; accent-color: var(--brand-primary); flex-shrink: 0; }
.recipe-detail__ing-text { font-size: 13px; color: var(--text-primary); }
.recipe-detail__add-one {
  background: none; border: 1.5px solid var(--brand-primary); color: var(--brand-primary);
  border-radius: 50%; width: 26px; height: 26px; font-size: 16px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: background 150ms, color 150ms;
}
.recipe-detail__add-one:hover    { background: var(--brand-primary); color: #fff; }
.recipe-detail__add-one:disabled { opacity: .4; cursor: default; }

.recipe-detail__steps  { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.recipe-detail__steps li { font-size: 13px; color: var(--text-primary); line-height: 1.5; }

/* ── Loading ── */
.recipes-loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 60px 24px; color: var(--text-secondary); font-size: 14px;
}

/* ── Danger btn ── */
.btn--danger {
  background: rgba(239,68,68,.1); color: #dc2626;
  border: 1.5px solid rgba(239,68,68,.3);
}
.btn--danger:hover { background: rgba(239,68,68,.2); }

/* ── Loader "La YaYa" ── */
.yaya-loader {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 8, 30, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 300ms;
}
.yaya-loader.visible { opacity: 1; }
.yaya-loader__card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: var(--bg-surface);
  border-radius: 22px;
  padding: 32px 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  max-width: 300px; text-align: center;
  transform: scale(.92);
  transition: transform 300ms cubic-bezier(.34,1.56,.64,1);
}
.yaya-loader.visible .yaya-loader__card { transform: scale(1); }
.yaya-loader__avatar {
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  animation: yaya-bob 2s ease-in-out infinite;
}
.yaya-loader__img {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 50%;
}
@keyframes yaya-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
.yaya-loader__dots {
  display: flex; gap: 7px;
}
.yaya-loader__dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand-primary, #7C4A9E);
  animation: yaya-dot 1.2s ease-in-out infinite;
}
.yaya-loader__dots span:nth-child(2) { animation-delay: .2s; }
.yaya-loader__dots span:nth-child(3) { animation-delay: .4s; }
@keyframes yaya-dot {
  0%, 100% { transform: scale(.6); opacity: .4; }
  40%      { transform: scale(1);  opacity: 1; }
}
.yaya-loader__msg {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary); line-height: 1.4;
  margin: 0; min-height: 40px;
  transition: opacity 220ms;
}
