/* =============================================================================
 * AquaDynasty — views.css
 * Per-view styling: tanks, fish cards, market, research tree, staff, exports,
 * prestige, stats.
 * ========================================================================== */

/* ================= TANKS VIEW ================= */

.tank-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.tank-card { padding: 0; overflow: hidden; cursor: pointer; }
.tank-card .tank-canvas-wrap {
  position: relative;
  height: 170px;
  background: linear-gradient(180deg, #0a1c33, #071426);
}
.tank-card canvas { width: 100%; height: 100%; }

.tank-card-head {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(5, 10, 20, 0.72), transparent);
  z-index: 2;
}
.tank-name { font-weight: 800; font-size: 14px; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.tank-tier { font-size: 11px; color: var(--tx1); font-weight: 600; }

.tank-alerts { position: absolute; bottom: 8px; left: 10px; display: flex; gap: 5px; z-index: 2; }
.tank-alert {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid rgba(255, 107, 122, 0.5);
  font-size: 13px;
  animation: alert-blink 1.6s ease-in-out infinite;
}
@keyframes alert-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.tank-eggs-pill {
  position: absolute; bottom: 8px; right: 10px; z-index: 2;
  background: rgba(10, 16, 30, 0.85);
}

.tank-card-body { padding: 11px 14px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tank-meters { flex: 1; min-width: 0; }
.tank-quick { display: flex; gap: 6px; }

.buy-tank-card {
  min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--line-hi);
  background: transparent;
  cursor: pointer;
  color: var(--tx2);
  transition: all 0.2s ease;
}
.buy-tank-card:hover { border-color: var(--acc); color: var(--acc); background: rgba(55, 214, 255, 0.04); }
.buy-tank-card .plus { font-size: 38px; font-weight: 300; }

/* ---- tank detail modal ---- */

.tank-detail-canvas-wrap { position: relative; height: 240px; border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; background: #081426; }
.tank-detail-canvas-wrap canvas { width: 100%; height: 100%; }

.water-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 9px; margin-bottom: 6px; }
.gauge {
  padding: 9px 11px;
  background: rgba(10, 20, 36, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.gauge-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--tx2); font-weight: 700; display: flex; justify-content: space-between; }
.gauge-value { font-size: 16px; font-weight: 800; font-family: var(--mono); margin: 3px 0 5px; }
.gauge-value.ok { color: var(--green); }
.gauge-value.warn { color: var(--orange); }
.gauge-value.bad { color: var(--red); }

.temp-adjust { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.temp-adjust button {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-hi);
  background: var(--glass-hi); color: var(--tx0); cursor: pointer; font-weight: 800;
}
.temp-adjust button:hover { background: rgba(148,190,255,0.2); }

.equip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.equip-slot {
  flex: 1; min-width: 100px;
  padding: 9px 10px;
  background: rgba(10, 20, 36, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: center; cursor: pointer;
  transition: all 0.15s ease;
}
.equip-slot:hover { border-color: var(--line-hi); background: rgba(148,190,255,0.08); }
.equip-slot .eq-icon { font-size: 19px; }
.equip-slot .eq-name { font-size: 10.5px; color: var(--tx2); font-weight: 700; margin-top: 2px; }
.equip-slot .eq-lvl { font-size: 11px; font-weight: 800; color: var(--acc); }
.equip-slot.maxed .eq-lvl { color: var(--gold); }

/* ---- fish cards ---- */

.fish-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }

.fish-card {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 11px;
  background: linear-gradient(150deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.fish-card:hover { border-color: var(--line-hi); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.fish-card.selected { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 0 16px rgba(55, 214, 255, 0.25); }
.fish-card.legendary-glow::before {
  content: "";
  position: absolute; inset: -40%;
  background: conic-gradient(transparent 60%, rgba(255, 209, 102, 0.28), transparent 80%);
  animation: legendary-spin 3.2s linear infinite;
  pointer-events: none;
}
@keyframes legendary-spin { to { transform: rotate(360deg); } }

.fish-thumb {
  width: 62px; height: 44px; flex-shrink: 0;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 40%, #10233d, #0a1628);
  overflow: hidden;
  position: relative; z-index: 1;
}
.fish-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.fish-name { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fish-meta { font-size: 11px; color: var(--tx2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fish-price { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--gold); position: relative; z-index: 1; }
.fish-fav { position: absolute; top: 5px; right: 7px; font-size: 11px; z-index: 2; }

.gender-m { color: #6cb8ff; } .gender-f { color: #ff9ecf; }

/* fish detail modal */
.fish-detail-top { display: flex; gap: 16px; align-items: flex-start; }
.fish-detail-canvas {
  width: 190px; height: 130px; flex-shrink: 0;
  border-radius: var(--r-md);
  background: radial-gradient(circle at 50% 35%, #122946, #0a1628);
  overflow: hidden;
}
.fish-detail-stats { flex: 1; min-width: 0; }
.gene-table { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin-top: 8px; }
.gene-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.gene-row .g-name { color: var(--tx2); font-weight: 600; }
.gene-row .g-val { font-weight: 700; }

/* goals widget */
.goals-card { margin-top: 18px; }
.goal-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.goal-row:last-child { border-bottom: none; }
.goal-row .goal-icon { font-size: 16px; }
.goal-row .goal-text { flex: 1; color: var(--tx1); }
.goal-row .goal-req { font-family: var(--mono); font-size: 11.5px; color: var(--tx2); }

/* ================= MARKET VIEW ================= */

.market-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.market-table th {
  text-align: left; padding: 9px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--tx2);
  border-bottom: 1px solid var(--line);
}
.market-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.market-table tr { transition: background 0.15s ease; }
.market-table tbody tr:hover { background: var(--glass); }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.trend-hot { color: var(--gold); font-weight: 800; animation: legendary-pulse 1.6s ease-in-out infinite; }

.species-locked td { opacity: 0.55; }

.news-ticker {
  display: flex; flex-direction: column; gap: 7px;
}
.news-item { display: flex; gap: 9px; font-size: 12.5px; color: var(--tx1); padding: 7px 10px; background: var(--glass); border-radius: 8px; }

.sparkline { display: inline-block; vertical-align: middle; }

/* auction */
.auction-live {
  padding: 18px;
  border: 1px solid rgba(255, 209, 102, 0.4);
  background: linear-gradient(150deg, rgba(60, 45, 12, 0.35), var(--glass));
  border-radius: var(--r-md);
}
.auction-bid { font-size: 30px; font-weight: 800; font-family: var(--mono); color: var(--gold); }
.auction-timer { font-family: var(--mono); font-weight: 700; color: var(--red); }
.bid-history { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--tx1); }
.bid-history .bid-new { animation: view-in 0.3s ease; color: var(--tx0); font-weight: 700; }

/* ================= ORDERS VIEW ================= */

.order-card { display: flex; flex-direction: column; gap: 9px; }
.order-head { display: flex; align-items: center; gap: 10px; }
.order-cust-icon { font-size: 26px; }
.order-reqs { font-size: 12px; color: var(--tx1); }
.order-reqs .pill { margin: 2px 3px 0 0; }
.order-expire { font-size: 11px; color: var(--tx2); font-family: var(--mono); }
.order-progress-note { font-size: 12px; color: var(--tx1); }

/* ================= RESEARCH VIEW ================= */

.research-status { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.research-tier { margin-bottom: 8px; }
.research-node {
  display: flex; gap: 12px; align-items: flex-start;
  position: relative;
}
.research-node .rn-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: var(--glass-hi); border: 1px solid var(--line-hi);
}
.research-node.done .rn-icon { background: rgba(61, 220, 151, 0.15); border-color: rgba(61, 220, 151, 0.5); }
.research-node.active .rn-icon { border-color: var(--acc); box-shadow: 0 0 14px rgba(55, 214, 255, 0.35); animation: legendary-pulse 2s infinite; }
.research-node.locked { opacity: 0.5; }
.rn-body { flex: 1; min-width: 0; }
.rn-name { font-weight: 800; font-size: 14px; }
.rn-desc { font-size: 12px; color: var(--tx1); margin: 3px 0 8px; }
.rn-cost { font-family: var(--mono); font-size: 11.5px; color: var(--purple); font-weight: 700; }

/* ================= STAFF VIEW ================= */

.worker-card { display: flex; flex-direction: column; gap: 10px; }
.worker-head { display: flex; gap: 11px; align-items: center; }
.worker-avatar {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--glass-hi), rgba(55, 130, 255, 0.15));
  border: 1px solid var(--line-hi);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.worker-lvl {
  font-size: 10px; font-weight: 800; color: var(--acc);
  background: rgba(55, 214, 255, 0.12);
  padding: 2px 7px; border-radius: 999px;
}
.role-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ================= FACILITIES VIEW ================= */

.facility-card { display: flex; flex-direction: column; gap: 9px; }
.facility-icon-big { font-size: 32px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.facility-level-dots { display: flex; gap: 4px; }
.facility-level-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--glass-hi); border: 1px solid var(--line-hi); }
.facility-level-dots span.on { background: var(--acc); box-shadow: 0 0 7px var(--acc); border-color: transparent; }

/* ================= EXPORTS VIEW ================= */

.country-card { display: flex; flex-direction: column; gap: 8px; }
.country-flag { font-size: 30px; }
.demand-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.shipment-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.shipment-row .bar { flex: 1; }

/* ================= PRESTIGE VIEW ================= */

.prestige-hero {
  text-align: center;
  padding: 34px 22px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(500px 200px at 50% 0%, rgba(255, 209, 102, 0.12), transparent),
    linear-gradient(165deg, var(--glass-hi), var(--glass));
  border: 1px solid rgba(255, 209, 102, 0.25);
  margin-bottom: 22px;
}
.prestige-points { font-size: 44px; font-weight: 800; color: var(--gold); font-family: var(--mono); text-shadow: 0 0 30px rgba(255, 209, 102, 0.4); }
.legacy-card { display: flex; gap: 12px; align-items: flex-start; }
.legacy-icon { font-size: 26px; }

/* ================= STATS VIEW ================= */

.stat-tile {
  text-align: center; padding: 18px 12px;
}
.stat-tile .st-val { font-size: 24px; font-weight: 800; font-family: var(--mono); color: var(--acc); }
.stat-tile .st-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--tx2); font-weight: 700; margin-top: 4px; }

.codex-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.codex-item {
  text-align: center; padding: 14px 10px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.codex-item.unknown { opacity: 0.4; filter: grayscale(1); }
.codex-item .cx-icon { font-size: 26px; }
.codex-item .cx-name { font-size: 12px; font-weight: 700; margin-top: 5px; }

/* comp entries (competition modal) */
.comp-entries { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 10px; }
.comp-entry { flex-direction: column; padding: 12px 16px; line-height: 1.4; }
.merchant-genes { display: flex; flex-wrap: wrap; gap: 6px; }

/* settings modal */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: none; }
.switch { position: relative; width: 42px; height: 23px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: var(--glass-hi); border: 1px solid var(--line-hi);
  border-radius: 999px; transition: all 0.2s ease;
}
.switch .track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--tx1);
  transition: all 0.2s ease;
}
.switch input:checked + .track { background: rgba(55, 214, 255, 0.3); border-color: var(--acc); }
.switch input:checked + .track::after { left: 21px; background: var(--acc); box-shadow: 0 0 8px var(--acc); }

.save-io textarea {
  width: 100%; height: 90px;
  background: rgba(5, 10, 20, 0.8); border: 1px solid var(--line);
  border-radius: 8px; color: var(--tx1);
  font-family: var(--mono); font-size: 10.5px;
  padding: 9px; resize: vertical;
}
