/*
 * garden.css - Floralist Garden Block + Modal
 * Author:    Steven J. Cook (Shinra.Engineer)
 * Date:      2026-05-04
 * Time:      23:59 UTC
 * Model:     Claude Opus 4.7
 * Project:   Abyssal Engine Local Clone
 * Chat:      Phase 4: Garden Block + Modal
 * Revision:  1.1.0
 *
 * v1.1.0 - Companion to garden.js v1.1.0 which closes the v1.0.0
 *          known boundaries. New rules:
 *            .garden-self-clear-btn        Wrathful Carnation
 *                                          self-clear button
 *            .garden-tol-section-label     "Crisis Allies in
 *                                          Combat" header inside
 *                                          the Tree of Life modal
 *            .garden-tol-ally-btn          Per-tracker-entry heal
 *                                          button (full width with
 *                                          HP readout)
 *            .garden-tol-ally-hp           Right-aligned HP/maxHP
 *                                          inside the ally button
 *
 * v1.0.0 - Phase 4 of the Garden / Floralist rollout. Pairs with
 * cogs/garden.js v1.0.0. Styles the Garden block placed between
 * the Equipment and Inventory blocks (gated on Chloromancy SL >= 1)
 * and the Plant / Graft / Discovered / Tree of Life modals.
 *
 * Color palette:
 *   Garden green   = #4ade80 family    (Floralist primary)
 *   Tree of Life   = #57f287 family    (lighter healing tone)
 *   Graft amber    = inherits accent-amber
 *   Active pip     = solid green       (filled clock section)
 *   Empty pip      = ghosted green     (unfilled section)
 *
 * z-index: garden-modal-overlay sits at 11000, same tier as the
 * Phase 3 technosphere quality picker, so Garden modals render
 * above the standard sheet view (modal-overlay 10500) and the
 * item-detail-overlay (9998) in case the player has any of
 * those layered.
 */

/* ============================================================
 * GARDEN BLOCK ON THE SHEET
 * ============================================================ */

.garden-panel {
  /* Inherits .sheet-panel base styling. */
}

.garden-panel h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4em;
}

.garden-skill-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.garden-skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.1em 0.45em;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #79e9a3;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: help;
}

.garden-skill-badge.garden-skill-badge-life {
  background: rgba(87, 242, 135, 0.15);
  border-color: rgba(87, 242, 135, 0.45);
  color: #8efaa8;
}

.garden-skill-badge.garden-skill-badge-graft {
  background: rgba(240, 178, 50, 0.15);
  border-color: rgba(240, 178, 50, 0.4);
  color: #f7c569;
}

.garden-active-row {
  margin-top: 0.5em;
  padding: 0.6em 0.7em;
  border-radius: 6px;
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.18);
}

.garden-active-label {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.65em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #a8a9ad);
  margin-bottom: 0.2em;
}

.garden-active-name {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 1em;
  font-weight: 700;
  color: #4ade80;
  letter-spacing: 0.04em;
}

.garden-active-flavor {
  margin-top: 0.15em;
  font-size: 0.78em;
  color: var(--text-muted, #a8a9ad);
  font-style: italic;
  line-height: 1.35;
}

.garden-active-empty {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--text-faint, #6c6e75);
  font-style: italic;
  font-size: 0.85em;
}

.garden-clock-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 0.55em;
  padding: 0.4em 0.7em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.garden-clock-label {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.65em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #a8a9ad);
}

.garden-clock-pips {
  display: flex;
  gap: 0.25em;
  align-items: center;
}

.garden-pip {
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  border: 2px solid rgba(74, 222, 128, 0.45);
  background: transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.garden-pip.garden-pip-filled {
  background: #4ade80;
  border-color: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.garden-clock-tier {
  margin-left: auto;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #79e9a3;
}

.garden-tier-note {
  margin-top: 0.5em;
  padding: 0.5em 0.7em;
  border-radius: 6px;
  background: rgba(87, 242, 135, 0.08);
  border-left: 3px solid #57f287;
  color: #d6efe0;
  font-size: 0.82em;
  line-height: 1.4;
}

.garden-tier-note i {
  color: #57f287;
  margin-right: 0.3em;
}

.garden-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 0.6em;
}

.garden-actions .btn {
  font-size: 0.72em;
}

/* ============================================================
 * MODAL OVERLAYS
 * ============================================================ */

.garden-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
  padding: 1em;
}

.garden-modal-box {
  background: #2b2d31;
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 10px;
  padding: 1.5em;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
}

.garden-modal-box.garden-modal-narrow {
  max-width: 420px;
}

.garden-modal-box h3 {
  font-family: var(--font-display, 'Cinzel', serif);
  margin: 0 0 0.5em;
  font-size: 1.1em;
  color: #4ade80;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.garden-modal-subline {
  font-size: 0.85em;
  color: var(--text-muted, #a8a9ad);
  margin: 0 0 1em;
  line-height: 1.5;
}

.garden-modal-empty {
  margin: 0.75em 0 1.25em;
  padding: 0.9em 1em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #a8a9ad);
  font-size: 0.85em;
  line-height: 1.5;
}

.garden-modal-warning {
  margin: 0.5em 0 1em;
  padding: 0.65em 0.9em;
  border-radius: 6px;
  background: rgba(237, 66, 69, 0.1);
  border-left: 3px solid #ed4245;
  color: #ff9b9b;
  font-size: 0.85em;
  line-height: 1.45;
}

.garden-modal-warning i {
  margin-right: 0.3em;
}

.garden-modal-footnote {
  margin-top: 1em;
  font-size: 0.73em;
  color: var(--text-faint, #6c6e75);
  font-style: italic;
  line-height: 1.4;
}

.garden-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5em;
  margin-top: 1em;
  padding-top: 0.75em;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============================================================
 * MAGISEED CARD LIST (PLANT / GRAFT MODAL)
 * ============================================================ */

.garden-magiseed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 0.5em 0 1em;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.4em;
}

.garden-magiseed-card {
  padding: 0.75em 0.9em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(74, 222, 128, 0.22);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.garden-magiseed-card:hover {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.5);
}

.garden-magiseed-card:active {
  transform: scale(0.99);
}

.garden-magiseed-card.garden-magiseed-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.garden-magiseed-card.garden-magiseed-disabled:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(74, 222, 128, 0.22);
}

.garden-magiseed-card-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.95em;
  font-weight: 700;
  color: #79e9a3;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.garden-magiseed-card-flavor {
  margin-top: 0.2em;
  font-size: 0.78em;
  color: var(--text-muted, #a8a9ad);
  font-style: italic;
  line-height: 1.35;
}

.garden-magiseed-tier-list {
  margin-top: 0.4em;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.garden-tier-line {
  font-size: 0.78em;
  color: #d4d4d8;
  line-height: 1.35;
}

.garden-tier-range {
  display: inline-block;
  min-width: 3.4em;
  padding: 0 0.4em;
  margin-right: 0.35em;
  border-radius: 3px;
  background: rgba(87, 242, 135, 0.12);
  color: #8efaa8;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ============================================================
 * TREE OF LIFE MODAL OPTIONS
 * ============================================================ */

.garden-tol-options {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 0.75em 0;
}

.garden-tol-options .btn {
  width: 100%;
  justify-content: center;
}

.garden-tol-note {
  padding: 0.6em 0.85em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #a8a9ad);
  font-size: 0.82em;
  line-height: 1.45;
}

/* ============================================================
 * DISCOVERED MAGISEEDS GRID
 * ============================================================ */

.garden-discovered-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4em;
  margin: 0.5em 0 1em;
}

.garden-discovered-pill {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.5em 0.7em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.85em;
}

.garden-discovered-pill:hover {
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.3);
}

.garden-discovered-pill.garden-discovered-on {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.55);
}

.garden-discovered-pill input[type="checkbox"] {
  margin: 0;
  accent-color: #4ade80;
  cursor: pointer;
}

.garden-discovered-name {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: #d4d4d8;
}

.garden-discovered-pill.garden-discovered-on .garden-discovered-name {
  color: #79e9a3;
  font-weight: 600;
}

/* ============================================================
 * v1.1.0 ADDITIONS: COMBAT TRACKER + WRATHFUL SELF-CLEAR
 * ============================================================ */

/* Wrathful Carnation self-clear button. Sits next to Graft and
 * Remove on the Garden block when wrathful_carnation is active.
 * Tinted red to evoke its blood-red bloom flavor and to read
 * as a "consume the magiseed" action without being aggressive
 * enough to look like a destructive Remove. */
.garden-self-clear-btn {
  background: rgba(237, 66, 69, 0.12) !important;
  border: 1px solid rgba(237, 66, 69, 0.45) !important;
  color: #ff9b9b !important;
}

.garden-self-clear-btn:hover {
  background: rgba(237, 66, 69, 0.22) !important;
  border-color: #ed4245 !important;
  color: #ff7a7d !important;
}

/* Tree of Life modal: section divider for the "Crisis Allies in
 * Combat" header that appears between the self-heal button and
 * the per-ally buttons. */
.garden-tol-section-label {
  margin: 0.6em 0 0.2em;
  padding-top: 0.5em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #a8a9ad);
}

/* Per-ally heal button. Full width, name on the left, HP readout
 * on the right. Uses the ghost-button base but with a subtle
 * green-life tint that matches the Tree of Life theme. */
.garden-tol-ally-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.55em !important;
  background: rgba(87, 242, 135, 0.06) !important;
  border: 1px solid rgba(87, 242, 135, 0.25) !important;
  color: #b6f0c5 !important;
  text-align: left !important;
}

.garden-tol-ally-btn:hover {
  background: rgba(87, 242, 135, 0.15) !important;
  border-color: rgba(87, 242, 135, 0.55) !important;
  color: #d8f6e2 !important;
}

.garden-tol-ally-btn i {
  color: #ff9b9b;
  flex-shrink: 0;
}

.garden-tol-ally-hp {
  margin-left: auto;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  background: rgba(237, 66, 69, 0.18);
  border: 1px solid rgba(237, 66, 69, 0.4);
  color: #ffb3b3;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ============================================================
 * MOBILE TWEAKS
 * ============================================================ */

@media (max-width: 640px) {
  .garden-panel h3 {
    flex-direction: column;
    align-items: flex-start;
  }

  .garden-skill-badges {
    margin-top: 0.25em;
  }

  .garden-clock-row {
    flex-wrap: wrap;
  }

  .garden-clock-tier {
    margin-left: 0;
  }

  .garden-actions .btn {
    flex: 1;
    min-width: 8em;
  }

  .garden-modal-box {
    padding: 1.1em;
  }

  .garden-discovered-grid {
    grid-template-columns: 1fr;
  }
}
