/*!
 * InfraCalc.id — Design System & Custom Components
 * Tailwind-compatible custom utility and component styles.
 * (c) InfraCalc.id — https://infracalc.web.id
 */

/* Input & Form Controls */
.st-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.dark .st-input {
  border-color: #334155;
  background-color: #0f172a;
  color: #f8fafc;
}
.st-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.dark .st-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* Metric Result Cards */
.st-metric {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}
.dark .st-metric {
  background-color: #1e293b;
  border-color: #334155;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}
.st-metric:hover {
  border-color: #cbd5e1;
}
.dark .st-metric:hover {
  border-color: #475569;
}
.st-metric-accent {
  border-color: #3b82f6 !important;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%) !important;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}
.dark .st-metric-accent {
  border-color: #2563eb !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(30, 41, 59, 1) 100%) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}
.st-metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.dark .st-metric-label {
  color: #94a3b8;
}
.st-metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.dark .st-metric-value {
  color: #f8fafc;
}
.st-metric-sub {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
}
.dark .st-metric-sub {
  color: #60a5fa;
}
.st-metric-hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.25;
}
.dark .st-metric-hint {
  color: #94a3b8;
}

/* Tab Navigation */
.st-tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.st-tab:hover {
  color: #0f172a;
  border-bottom-color: #cbd5e1;
}
.dark .st-tab {
  color: #94a3b8;
}
.dark .st-tab:hover {
  color: #f8fafc;
  border-bottom-color: #475569;
}
.st-tab-active {
  color: #2563eb !important;
  border-bottom-color: #2563eb !important;
  font-weight: 600;
}
.dark .st-tab-active {
  color: #60a5fa !important;
  border-bottom-color: #60a5fa !important;
}

/* Segmented Controls & Chips */
.st-seg-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  transition: all 0.15s ease;
}
.dark .st-seg-btn {
  border-color: #334155;
  background-color: #0f172a;
  color: #94a3b8;
}
.st-seg-btn:hover {
  background-color: #f8fafc;
  color: #0f172a;
}
.dark .st-seg-btn:hover {
  background-color: #1e293b;
  color: #f8fafc;
}
.st-seg-active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}
.st-chip {
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dark .st-chip {
  border-color: #334155;
  background-color: #1e293b;
  color: #94a3b8;
}
.st-chip:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}
.dark .st-chip:hover {
  border-color: #475569;
  color: #f8fafc;
}
.st-chip-active {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* Icon Buttons */
.st-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dark .st-icon-btn {
  border-color: #334155;
  background-color: #1e293b;
  color: #f87171;
}
.st-icon-btn:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
}
.dark .st-icon-btn:hover {
  background-color: #7f1d1d;
  border-color: #b91c1c;
}

/* Tables */
/* Pastikan pembungkus tabel VLSM bisa di-scroll horizontal dengan rapi */
.vlsm-table-container,
#subnet table {
  width: 100%;
  border-collapse: collapse;
}

#subnet th,
#subnet td {
  white-space: nowrap !important;
  padding: 0.65rem 0.85rem;
}

#tool-subnet th,
#tool-subnet td,
#sn-vlsm-out th,
#sn-vlsm-out td {
  white-space: nowrap !important;
  padding: 0.65rem 0.85rem;
}

.st-border {
  border-color: #e2e8f0;
}
.dark .st-border {
  border-color: #334155;
}
.st-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.st-table th {
  background-color: #f8fafc;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.dark .st-table th {
  background-color: #0f172a;
  color: #94a3b8;
  border-color: #334155;
}
.st-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.dark .st-table td {
  border-color: #1e293b;
}
.st-table tbody tr:hover {
  background-color: #f8fafc;
}
.dark .st-table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.6);
}
.st-row-active {
  background-color: #eff6ff !important;
  font-weight: 600;
}
.dark .st-row-active {
  background-color: rgba(30, 58, 138, 0.35) !important;
}
.st-row-error {
  background-color: #fef2f2 !important;
  color: #dc2626;
}
.dark .st-row-error {
  background-color: rgba(127, 29, 29, 0.3) !important;
  color: #fca5a5;
}

/* Alert Boxes */
.st-alert-error {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
}
.dark .st-alert-error {
  background-color: #450a0a;
  border-color: #991b1b;
  color: #fca5a5;
}

/* CLI Syntax Highlighting */
.tok-comment { color: #64748b; font-style: italic; }
.dark .tok-comment { color: #64748b; }
.tok-string { color: #059669; }
.dark .tok-string { color: #34d399; }
.tok-path { color: #2563eb; font-weight: 600; }
.dark .tok-path { color: #60a5fa; }
.tok-keyword { color: #7c3aed; font-weight: 600; }
.dark .tok-keyword { color: #c084fc; }
.tok-key { color: #d97706; }
.dark .tok-key { color: #fbbf24; }
.tok-op { color: #94a3b8; }
.tok-flag { color: #db2777; }
.dark .tok-flag { color: #f472b6; }

/* Copy Feedback */
.st-copied {
  background-color: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

/* Container Slot Iklan Anti-CLS (Ramah Core Web Vitals) */
.st-ad-slot {
  width: 100%;
  min-height: 90px;
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dark .st-ad-slot {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(71, 85, 105, 0.45);
}
.st-ad-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.25rem;
}

/* Wadah Slot Iklan Khusus Halaman Tools (Anti-Layout Shift) */
.st-tool-ad {
  width: 100%;
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.8);
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}
.dark .st-tool-ad {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 85, 105, 0.5);
}
.st-tool-ad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.5rem;
}
.st-tool-ad-Leaderboard { min-height: 96px; }
.st-tool-ad-MidResult   { min-height: 110px; }
.st-tool-ad-Sidebar     { min-height: 260px; }
