/* handy-cook.css — HandyCook module styles */

.hc-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.hc-header {
  text-align: center;
  margin-bottom: 2rem;
}

.hc-header__icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.hc-header__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fa-primary);
  margin: 0 0 0.5rem;
}

.hc-header__subtitle {
  color: var(--fa-text-secondary);
  font-size: 1rem;
  margin: 0;
}

/* ── Ingredient Input Panel ──────────────────────────────────────────────── */

.hc-input-panel {
  background: var(--fa-bg);
  border: 1px solid var(--fa-primary-20);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(40, 54, 85, 0.06);
}

.hc-input-panel__label {
  display: block;
  font-weight: 600;
  color: var(--fa-primary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.hc-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.hc-input-row input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1.5px solid var(--fa-primary-20);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--fa-text-primary);
  background: var(--fa-bg);
  transition: border-color 0.2s;
  outline: none;
}

.hc-input-row input:focus {
  border-color: var(--fa-primary);
}

.hc-input-row input::placeholder {
  color: var(--fa-text-muted);
}

.hc-btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.hc-btn:active { transform: scale(0.97); }

.hc-btn--add {
  background: var(--fa-primary);
  color: #fff;
}

.hc-btn--add:hover { background: var(--fa-primary-hover); }

.hc-btn--search {
  background: var(--fa-accent);
  color: #fff;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 1rem;
  border-radius: 8px;
}

.hc-btn--search:hover { background: var(--fa-accent-hover); }

.hc-btn--search:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hc-btn--clear {
  background: transparent;
  border: 1.5px solid var(--fa-primary-20);
  color: var(--fa-text-secondary);
  padding: 0.5rem 0.875rem;
  font-size: 0.85rem;
}

.hc-btn--clear:hover {
  border-color: var(--fa-error);
  color: var(--fa-error);
}

.hc-btn--spaced {
  margin-top: 1.5rem;
}

/* ── Chips ───────────────────────────────────────────────────────────────── */

.hc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 2rem;
  margin: 0.75rem 0 0;
  padding: 0;
}

.hc-chips:empty::after {
  content: attr(data-empty);
  color: var(--fa-text-muted);
  font-size: 0.85rem;
  align-self: center;
}

.hc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--fa-primary-surface);
  color: var(--fa-primary);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.hc-chip__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fa-primary);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.hc-chip__remove:hover { opacity: 1; }

/* ── Results ─────────────────────────────────────────────────────────────── */

.hc-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.hc-results-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fa-primary);
  margin: 0;
}

.hc-results-count {
  font-size: 0.85rem;
  color: var(--fa-text-muted);
  white-space: nowrap;
}

.hc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.hc-card {
  background: var(--fa-bg);
  border: 1px solid var(--fa-primary-10);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.hc-card:hover {
  box-shadow: 0 4px 16px rgba(40, 54, 85, 0.1);
  border-color: var(--fa-primary-20);
  transform: translateY(-2px);
}

.hc-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hc-card__title {
  font-weight: 600;
  color: var(--fa-primary);
  font-size: 0.95rem;
  line-height: 1.3;
  flex: 1;
  margin: 0;
}

.hc-card__score {
  flex-shrink: 0;
  background: var(--fa-accent-surface);
  color: var(--fa-accent-hover);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.hc-card__score--high {
  background: var(--fa-success-bg);
  color: var(--fa-success);
}

.hc-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.hc-tag {
  background: var(--fa-bg-alt);
  color: var(--fa-text-secondary);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
}

.hc-card__ingredients {
  font-size: 0.8rem;
  color: var(--fa-text-muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── States ──────────────────────────────────────────────────────────────── */

.hc-state {
  text-align: center;
  padding: 3rem 1rem;
}

.hc-state--hero {
  padding-top: 5rem;
}

.hc-state__icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
}

.hc-state__title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fa-primary);
  margin: 0 0 0.5rem;
}

.hc-state__text {
  color: var(--fa-text-secondary);
  margin: 0 auto;
  max-width: 360px;
  font-size: 0.9rem;
}

.hc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--fa-text-muted);
}

.hc-loading--modal {
  padding: 3rem 0;
}

.hc-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--fa-primary-20);
  border-top-color: var(--fa-primary);
  border-radius: 50%;
  animation: hc-spin 0.7s linear infinite;
}

@keyframes hc-spin { to { transform: rotate(360deg); } }

.hc-actions-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .hc-page { padding: 1rem 0.75rem 3rem; }
  .hc-results-grid { grid-template-columns: 1fr; }
  .hc-header__title { font-size: 1.4rem; }
}

/* ── Recipe detail overlay ──────────────────────────────────────────────── */

.hc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
}

.hc-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hc-overlay__panel {
  position: relative;
  background: var(--fa-surface, #fff);
  border-radius: 1rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}

.hc-overlay__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--fa-text-secondary, #6b7280);
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.hc-overlay__close:hover { color: var(--fa-text, #111); }

.hc-overlay__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 2rem 1rem 0;
  color: var(--fa-text, #111);
}

.hc-overlay__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.hc-overlay__section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--fa-text, #111);
}

.hc-overlay__ingredients {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--fa-text-secondary, #374151);
}

.hc-overlay__instructions {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--fa-text-secondary, #374151);
}

.hc-overlay__instructions li + li,
.hc-overlay__ingredients li + li {
  margin-top: 0.25rem;
}

@media (max-width: 600px) {
  .hc-overlay { padding: 0.5rem; align-items: flex-end; }
  .hc-overlay__panel { border-radius: 1rem 1rem 0 0; max-height: 92vh; }
}
