/* =====================================================================
   components.css — kartu, tombol, slider, statistik, log, tabel, dsb.
   ===================================================================== */

/* Kartu */
.card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}
.canvas-card { padding: 12px; }
.canvas-card canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.25);
  background: #274b6e;
}

/* Tombol */
.btn {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--orange-dark); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: #7f8c8d; cursor: not-allowed; opacity: 0.8; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #962d22; }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 6px 12px; font-size: 0.82rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

.controls {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* Form */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 0.85rem; }
.field > span { color: var(--text-muted); }
.inline-field { display: flex; flex-direction: column; gap: 2px; font-size: 0.82rem; }
.inline-field > span { color: var(--text-muted); }

select, input[type="search"], input[type="text"] {
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-family: var(--font);
  width: 100%;
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.month-ticks {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -2px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  cursor: pointer;
}
.check input { accent-color: var(--accent); }

/* Statistik */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stats-grid-1 { grid-template-columns: 1fr; }
.stat {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-orange { border-left-color: var(--orange); }
.stat-blue { border-left-color: var(--blue); }
.stat-green { border-left-color: var(--green); }
.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.stat-value { font-size: 1.1rem; font-weight: 700; }

.meter {
  height: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.meter-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e74c3c, #f1c40f, #2ecc71);
  transition: width 0.4s;
}

/* Lencana musim */
.season-badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.season-badge[data-kind="panas"]  { background: #e67e22; color: #fff; }
.season-badge[data-kind="dingin"] { background: #5dade2; color: #06213a; }
.season-badge[data-kind="semi"]   { background: #58d68d; color: #06301a; }
.season-badge[data-kind="gugur"]  { background: #ca6f1e; color: #fff; }
.season-badge[data-kind="hujan"]  { background: #2e86c1; color: #fff; }
.season-badge[data-kind="kemarau"]{ background: #f4d03f; color: #3a2b00; }
.season-badge[data-kind="kutub"]  { background: #d6eaf8; color: #0b2a44; }
.season-badge[data-kind="peralihan"] { background: #a569bd; color: #fff; }

/* Chip musim di info zona */
.season-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.season-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.season-item .season-name { font-weight: 700; }
.season-item .season-months { font-size: 0.75rem; color: var(--text-muted); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--surface-2);
  margin: 2px 4px 2px 0;
}

/* Log */
.log-box {
  background: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.8rem;
  height: 190px;
  overflow-y: auto;
  border: 1px solid #4a69bd;
}
.log-item { margin-bottom: 3px; color: var(--green); }
.log-warn { color: #f39c12; }
.log-info { color: #85c1e9; }

/* Tabel */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table th, .table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
.table tbody tr { cursor: pointer; transition: background 0.15s; }
.table tbody tr:hover { background: var(--surface); }
.zone-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Bagian yang dapat dilipat (orbit bumi) */
details.orbit-wrap > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0;
  text-align: left;
  user-select: none;
}
details.orbit-wrap > summary::-webkit-details-marker { display: none; }
details.orbit-wrap > summary::after { content: " ▾"; }
details.orbit-wrap[open] > summary::after { content: " ▴"; }

/* SVG diagram sirkulasi */
.svg-wrap { margin: 6px 0 10px; }
.svg-wrap svg { width: 100%; height: auto; display: block; }

@media (max-width: 640px) {
  .season-item { grid-template-columns: 1fr; }
}
