/* ═══════════════════════════════════════════════════
   ICMC Excel Splitter — style.css
   ═══════════════════════════════════════════════════ */
:root {
  --navy:   #0d1b2a;
  --navy2:  #1a2d42;
  --navy3:  #243c57;
  --gold:   #e8a117;
  --gold2:  #f5c35a;
  --cream:  #f8f4ec;
  --white:  #ffffff;
  --gray:   #8a99aa;
  --light:  #dce5ef;
  --green:  #2d9c6e;
  --red:    #c0392b;
  --shadow: 0 8px 40px rgba(13,27,42,0.22);
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--navy);
  min-height: 100vh;
  color: var(--white);
}

/* ── HEADER ── */
header {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo-badge {
  width: 42px; height: 42px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.header-text { flex: 1; }
.header-text h1 { font-size: 1.15rem; font-weight: 700; }
.header-text p  { font-size: 0.72rem; color: var(--gray); }
.header-nav { display: flex; gap: 8px; }
.nav-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.nav-btn:hover, .nav-btn.active {
  background: rgba(232,161,23,0.12);
  color: var(--gold);
  border-color: rgba(232,161,23,0.3);
}

/* ── MAIN ── */
main { max-width: 960px; margin: 0 auto; padding: 36px 24px 80px; }

/* ── STEPS ── */
.steps {
  display: flex;
  background: var(--navy2);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 28px;
}
.step {
  flex: 1; padding: 13px 8px;
  text-align: center;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gray);
  transition: all 0.3s;
}
.step.active { color: var(--gold); background: rgba(232,161,23,0.08); }
.step.done   { color: var(--green); }
.step-num { display: block; font-size: 1.3rem; margin-bottom: 2px; font-family: 'IBM Plex Mono', monospace; }

/* ── CARD ── */
.card {
  background: var(--navy2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 0.82rem; font-weight: 700;
  color: var(--gold);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 5px;
}
.card p.sub { color: var(--gray); font-size: 0.8rem; margin-bottom: 18px; }

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed rgba(232,161,23,0.35);
  border-radius: 12px;
  padding: 50px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: rgba(232,161,23,0.02);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--gold);
  background: rgba(232,161,23,0.06);
  transform: translateY(-1px);
}
.dropzone input { display: none; }
.drop-icon { font-size: 2.8rem; margin-bottom: 10px; display: block; }
.dropzone h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 5px; }
.dropzone p  { color: var(--gray); font-size: 0.78rem; }
.hint {
  display: inline-block; margin-top: 10px;
  background: rgba(232,161,23,0.12);
  color: var(--gold); padding: 3px 12px;
  border-radius: 20px; font-size: 0.68rem;
  font-weight: 600; font-family: 'IBM Plex Mono', monospace;
}

/* ── FILE INFO ── */
.file-info {
  display: none; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: rgba(45,156,110,0.08);
  border: 1px solid rgba(45,156,110,0.25);
  border-radius: 10px; margin-top: 14px;
}
.file-info.show { display: flex; }
.file-icon { font-size: 1.8rem; }
.file-details { flex: 1; }
.file-details h4 { font-size: 0.88rem; font-weight: 600; }
.file-details span { font-size: 0.73rem; color: var(--gray); }
.server-badge {
  background: rgba(45,156,110,0.2); color: #6ddbb4;
  padding: 4px 10px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}

/* ── PROGRESS ── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.07);
  border-radius: 99px; height: 6px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  border-radius: 99px; width: 0%; transition: width 0.4s ease;
}
.upload-progress { margin-top: 14px; }

/* ── ALERT ── */
.alert {
  padding: 11px 15px; border-radius: 8px;
  font-size: 0.8rem; margin-top: 12px; display: none;
}
.alert.show { display: block; }
.alert-warn    { background: rgba(232,161,23,0.12); border: 1px solid rgba(232,161,23,0.25); color: var(--gold2); }
.alert-success { background: rgba(45,156,110,0.12); border: 1px solid rgba(45,156,110,0.25); color: #6ddbb4; }
.alert-error   { background: rgba(192,57,43,0.12);  border: 1px solid rgba(192,57,43,0.25);  color: #e07060; }

/* ── FORM FIELDS ── */
label.field-label {
  display: block; font-size: 0.72rem; font-weight: 600;
  color: var(--gray); text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 7px;
}
select, input[type=text] {
  width: 100%; padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; color: var(--white);
  font-family: 'Sora', sans-serif; font-size: 0.83rem;
  outline: none; transition: border 0.2s; appearance: none;
}
select:focus, input:focus { border-color: var(--gold); }
select option { background: var(--navy2); }

/* ── PREVIEW TABLE ── */
.preview-wrap { overflow: auto; max-height: 210px; border-radius: 8px; }
table.preview-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; font-family: 'IBM Plex Mono', monospace; }
table.preview-table th {
  background: rgba(232,161,23,0.14); color: var(--gold);
  padding: 6px 10px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid rgba(232,161,23,0.25); position: sticky; top: 0;
}
table.preview-table td {
  padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap; color: var(--light);
}
table.preview-table tr:hover td { background: rgba(255,255,255,0.03); }

/* ── GROUPS GRID ── */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 10px; margin-top: 14px; }
.group-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px; padding: 12px 14px; transition: border 0.2s;
}
.group-card:hover { border-color: rgba(232,161,23,0.35); }
.group-card .sheet-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem; font-weight: 600; color: var(--gold); margin-bottom: 5px;
}
.group-card .counties { font-size: 0.68rem; color: var(--gray); line-height: 1.6; }
.group-card .row-count { margin-top: 6px; font-size: 0.67rem; font-family: 'IBM Plex Mono', monospace; color: var(--green); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 22px; border-radius: 8px;
  font-family: 'Sora', sans-serif; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: none;
  transition: all 0.2s; text-decoration: none;
}
.btn-primary  { background: var(--gold); color: var(--navy); }
.btn-primary:hover:not(:disabled) { background: var(--gold2); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,161,23,0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { background: rgba(255,255,255,0.07); color: var(--white); border: 1px solid rgba(255,255,255,0.12); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-success  { background: var(--green); color: var(--white); }
.btn-success:hover { background: #37b880; transform: translateY(-1px); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Small buttons for history table */
.btn-sm {
  display: inline-block; padding: 4px 10px; border-radius: 5px;
  font-size: 0.68rem; font-weight: 600;
  background: rgba(255,255,255,0.07); color: var(--light);
  text-decoration: none; transition: all 0.2s; border: 1px solid rgba(255,255,255,0.1);
  margin-right: 4px;
}
.btn-sm:hover { background: rgba(255,255,255,0.14); }
.btn-sm.gold  { background: rgba(232,161,23,0.15); color: var(--gold); border-color: rgba(232,161,23,0.25); }
.btn-sm.gold:hover { background: rgba(232,161,23,0.25); }
.btn-sm.danger { background: rgba(192,57,43,0.12); color: #e07060; border-color: rgba(192,57,43,0.2); }
.btn-sm.danger:hover { background: rgba(192,57,43,0.22); }

/* ── DIVIDER ── */
.divider { height: 1px; background: rgba(255,255,255,0.06); margin: 20px 0; }

/* ── HISTORY TABLE ── */
#history-section { margin-top: 40px; }
.history-table-wrap { overflow-x: auto; margin-top: 14px; }
table.history-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.78rem;
}
table.history-table th {
  background: rgba(232,161,23,0.1); color: var(--gold);
  padding: 9px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid rgba(232,161,23,0.2);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px;
}
table.history-table td {
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle; color: var(--light);
}
table.history-table tr:hover td { background: rgba(255,255,255,0.02); }
.file-badge { margin-right: 4px; }
.file-badge.result { }
.actions { white-space: nowrap; }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; }
.gray { color: var(--gray); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--gray); font-size: 0.83rem;
}
.empty-state span { display: block; margin-bottom: 10px; }

/* ── FOOTER ── */
footer {
  text-align: center; padding: 22px;
  color: var(--gray); font-size: 0.72rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; justify-content: center; gap: 20px;
}

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: var(--navy);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

@media (max-width: 600px) {
  header { padding: 12px 16px; }
  .header-nav { display: none; }
  main { padding: 20px 14px 60px; }
  .card { padding: 20px 16px; }
  .steps .step { font-size: 0.6rem; }
}
