/*
 * technosphere_equip.css - Equipment Modal Sphere/Seed UI
 * Author:    Steven J. Cook (Shinra.Engineer)
 * Date:      2026-05-04
 * Time:      23:35 UTC
 * Model:     Claude Opus 4.7
 * Project:   Abyssal Engine Local Clone
 * Chat:      Phase 3: Equipment Modal Spheres + Seeds
 * Revision:  1.0.0
 *
 * Phase 3 of the Techno Fantasy Equip System rollout. This stylesheet
 * dresses the new Spheres/Seeds section that inventory.js v3.7.0
 * injects into showItemDetailModal when CURRENT_SHEET.data
 * techno_equip_enabled is true and the item is a weapon, armor,
 * shield, or accessory.
 *
 * Conventions (per Atlas):
 *   alpha = 1 slot       (free, automatic)
 *   beta  = 2 slots      (+600z, max 1 mnemosphere)
 *   gamma = 3 slots      (+1500z, max 2 mnemospheres)
 *   delta = 4 slots      (+1800z, weapons only, max 2 mnemospheres)
 *
 * Color palette mirrors technosphere_inventory.css badges:
 *   Mnemosphere = purple (#a797ff family)
 *   Hoplosphere = green  (#4ade80 family)
 *   Empty slot  = muted grey
 *   Locked      = dimmed
 *   Coag count  = amber  (matches existing accent-amber)
 */

/* ============================================================
 * SECTION HEADER + SLOT QUALITY BAR
 * ============================================================ */

.tf-spheres-section {
  margin-top: 1em;
  padding-top: 0.75em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tf-spheres-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 0.6em;
}

.tf-spheres-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-amber, #f0b232);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

.tf-quality-bar {
  display: flex;
  align-items: center;
  gap: 0.4em;
  flex-wrap: wrap;
}

.tf-quality-label {
  font-size: 0.75em;
  color: var(--text-muted, #a8a9ad);
  font-family: var(--font-display, 'Cinzel', serif);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tf-quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(120, 100, 220, 0.15);
  border: 1px solid rgba(120, 100, 220, 0.4);
  color: #c5b8ff;
}

.tf-quality-pill[data-quality="alpha"] {
  background: rgba(180, 180, 180, 0.1);
  border-color: rgba(180, 180, 180, 0.3);
  color: #d0d0d4;
}

.tf-quality-pill[data-quality="beta"] {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
  color: #79e9a3;
}

.tf-quality-pill[data-quality="gamma"] {
  background: rgba(88, 101, 242, 0.18);
  border-color: rgba(88, 101, 242, 0.5);
  color: #a3acff;
}

.tf-quality-pill[data-quality="delta"] {
  background: rgba(240, 178, 50, 0.18);
  border-color: rgba(240, 178, 50, 0.5);
  color: #f7c569;
}

.tf-quality-edit-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #a8a9ad);
  font-size: 0.7em;
  font-family: var(--font-display, 'Cinzel', serif);
  padding: 0.2em 0.55em;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tf-quality-edit-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
 * SLOT LIST (STACKED ROWS)
 * ============================================================ */

.tf-slot-list {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.tf-slot-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 0.6em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: background 0.15s, border-color 0.15s;
}

.tf-slot-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.tf-slot-index {
  font-family: var(--font-display, 'Cinzel', serif);
  font-weight: 700;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  color: var(--text-muted, #a8a9ad);
  min-width: 2.4em;
  text-align: center;
  text-transform: uppercase;
}

.tf-slot-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
}

.tf-slot-empty {
  color: var(--text-faint, #6c6e75);
  font-style: italic;
  font-size: 0.85em;
}

.tf-slot-sphere-name {
  font-weight: 600;
  font-size: 0.9em;
}

.tf-slot-sphere-name.tf-mnemo {
  color: #c5b8ff;
}

.tf-slot-sphere-name.tf-hoplo {
  color: #79e9a3;
}

.tf-slot-coag {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: rgba(240, 178, 50, 0.15);
  border: 1px solid rgba(240, 178, 50, 0.4);
  color: var(--accent-amber, #f0b232);
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tf-slot-actions {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.tf-slot-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #a8a9ad);
  font-size: 0.75em;
  padding: 0.2em 0.55em;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tf-slot-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.tf-slot-btn.tf-slot-btn-add {
  color: #79e9a3;
  border-color: rgba(74, 222, 128, 0.35);
}

.tf-slot-btn.tf-slot-btn-add:hover {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.tf-slot-btn.tf-slot-btn-remove {
  color: #ff8a8a;
  border-color: rgba(237, 66, 69, 0.35);
}

.tf-slot-btn.tf-slot-btn-remove:hover {
  background: rgba(237, 66, 69, 0.12);
  color: #ed4245;
}

.tf-slot-cap-note {
  margin-top: 0.4em;
  font-size: 0.75em;
  color: var(--text-faint, #6c6e75);
  font-style: italic;
}

/* ============================================================
 * INVENTORY: GREYED-OUT LOCKED SPHERE ENTRIES
 * ============================================================ */

.inv-item.inv-item-locked {
  opacity: 0.55;
  position: relative;
}

.inv-item.inv-item-locked .inv-item-name {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

.inv-item.inv-item-locked .item-name-link {
  pointer-events: none;
  cursor: not-allowed;
}

.inv-locked-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: rgba(255, 138, 138, 0.1);
  border: 1px solid rgba(237, 66, 69, 0.3);
  color: #ff9b9b;
  font-size: 0.6em;
  font-family: var(--font-display, 'Cinzel', serif);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: help;
}

.inv-item.inv-item-locked .inv-act-sell,
.inv-item.inv-item-locked .inv-act-equip {
  display: none;
}

/* ============================================================
 * SLOT QUALITY PICKER MODAL (SECONDARY MODAL)
 * The picker uses its own root id so the original detail modal
 * can stay rendered behind it.
 * ============================================================ */

.tf-quality-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}

.tf-quality-picker-box {
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.5em;
  max-width: 480px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}

.tf-quality-picker-box h3 {
  font-family: var(--font-display, 'Cinzel', serif);
  margin: 0 0 0.6em;
  font-size: 1.1em;
  color: var(--accent-amber, #f0b232);
  letter-spacing: 0.04em;
}

.tf-quality-options {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 0.5em 0 1em;
}

.tf-quality-opt {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.65em 0.8em;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.tf-quality-opt:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
}

.tf-quality-opt.tf-quality-opt-current {
  background: rgba(120, 100, 220, 0.15);
  border-color: rgba(120, 100, 220, 0.45);
  cursor: default;
}

.tf-quality-opt.tf-quality-opt-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tf-quality-opt.tf-quality-opt-disabled:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.tf-quality-opt-pill {
  flex-shrink: 0;
}

.tf-quality-opt-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.tf-quality-opt-name {
  font-weight: 700;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.9em;
  color: #f4f4f6;
  letter-spacing: 0.04em;
}

.tf-quality-opt-rules {
  font-size: 0.75em;
  color: var(--text-muted, #a8a9ad);
}

.tf-quality-opt-cost {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.85em;
  font-weight: 700;
  color: var(--accent-amber, #f0b232);
}

.tf-quality-opt-cost-free {
  color: var(--text-faint, #6c6e75);
}

/* ============================================================
 * INSUFFICIENT-ZENIT WARNING + OVERRIDE BUTTON
 * ============================================================ */

.tf-zenit-warning {
  margin: 0.75em 0;
  padding: 0.7em 0.9em;
  border-radius: 6px;
  background: rgba(237, 66, 69, 0.12);
  border: 1px solid rgba(237, 66, 69, 0.4);
  color: #ff9999;
  font-size: 0.85em;
  line-height: 1.45;
}

.tf-zenit-warning strong {
  color: #ff5a5e;
}

.btn-override-equip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 0.95em;
  border-radius: 5px;
  background: rgba(237, 66, 69, 0.15);
  border: 1px solid #ed4245;
  color: #ff7a7d;
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-override-equip:hover {
  background: #ed4245;
  color: #fff;
}

/* ============================================================
 * "ARE YOU SURE?" CONFIRM MODAL (TERTIARY OVERLAY)
 * Sits over the quality-picker, which sits over the detail modal.
 * ============================================================ */

.tf-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11500;
}

.tf-confirm-box {
  background: #2b2d31;
  border: 2px solid #ed4245;
  border-radius: 10px;
  padding: 1.75em 1.5em 1.5em;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.tf-confirm-box h3 {
  font-family: var(--font-display, 'Cinzel', serif);
  margin: 0 0 0.5em;
  font-size: 1.2em;
  color: #ff7a7d;
  letter-spacing: 0.05em;
}

.tf-confirm-box p {
  margin: 0 0 1.2em;
  color: var(--text-muted, #a8a9ad);
  font-size: 0.9em;
  line-height: 1.5;
}

.tf-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 0.7em;
}

.tf-confirm-actions .btn {
  min-width: 5em;
}

/* ============================================================
 * SPHERE PICKER MODAL (CHOOSE FROM INVENTORY)
 * ============================================================ */

.tf-sphere-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  margin: 0.6em 0 1em;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.4em;
}

.tf-sphere-pick-row {
  display: flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 0.65em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tf-sphere-pick-row:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.tf-sphere-pick-row.tf-sphere-pick-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tf-sphere-pick-row.tf-sphere-pick-disabled:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.tf-sphere-pick-icon {
  width: 1.6em;
  text-align: center;
  font-size: 0.95em;
}

.tf-sphere-pick-icon.tf-mnemo {
  color: #c5b8ff;
}

.tf-sphere-pick-icon.tf-hoplo {
  color: #79e9a3;
}

.tf-sphere-pick-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}

.tf-sphere-pick-name {
  font-weight: 600;
  font-size: 0.9em;
  color: #f0f0f3;
}

.tf-sphere-pick-meta {
  font-size: 0.75em;
  color: var(--text-muted, #a8a9ad);
}

.tf-sphere-pick-blocked {
  font-size: 0.7em;
  color: #ff9b9b;
  font-style: italic;
}

.tf-sphere-picker-empty {
  padding: 1.25em;
  text-align: center;
  color: var(--text-faint, #6c6e75);
  font-style: italic;
  font-size: 0.85em;
}

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

@media (max-width: 640px) {
  .tf-spheres-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tf-quality-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .tf-slot-row {
    flex-wrap: wrap;
  }

  .tf-slot-content {
    width: 100%;
  }

  .tf-quality-picker-box,
  .tf-confirm-box {
    padding: 1.1em;
  }

  .tf-quality-opt {
    flex-wrap: wrap;
  }

  .tf-quality-opt-pill {
    margin-right: 0.4em;
  }
}
