/* ═══════════════════════════════════════════════════════════════════
   Tank Volume Analyzer — Premium Dark Glassmorphism Theme
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
@font-face {
  font-family: 'Inter';
  src: url('fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  --bg-deep:      #060b11;
  --bg-surface:   #0c1520;
  --glass-bg:     rgba(15, 25, 40, 0.65);
  --glass-border: rgba(32, 201, 151, 0.15);
  --glass-blur:   20px;

  --primary:      #20c997;
  --primary-glow: rgba(32, 201, 151, 0.35);
  --accent:       #0dcaf0;
  --accent-glow:  rgba(13, 202, 240, 0.25);

  --text-100:     #f0f4f8;
  --text-200:     #c4cdd8;
  --text-300:     #8896a6;
  --text-400:     #5a6a7a;

  --danger:       #ff6b6b;
  --success:      #20c997;
  --warning:      #ffc107;

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --shadow-glow:  0 0 40px rgba(32, 201, 151, 0.08),
                  0 0 80px rgba(13, 202, 240, 0.04);

  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition:   0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-200);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATED BACKGROUND PARTICLES
   ═══════════════════════════════════════════════════════════════════ */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-particles span {
  position: absolute;
  display: block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float linear infinite;
}

.bg-particles span:nth-child(1)  { left:  5%; animation-duration: 18s; animation-delay:  0s;   width: 4px; height: 4px; }
.bg-particles span:nth-child(2)  { left: 12%; animation-duration: 22s; animation-delay:  2s;   width: 3px; height: 3px; }
.bg-particles span:nth-child(3)  { left: 22%; animation-duration: 16s; animation-delay:  4s;   width: 5px; height: 5px; }
.bg-particles span:nth-child(4)  { left: 30%; animation-duration: 20s; animation-delay:  1s;   width: 3px; height: 3px; background: var(--accent); }
.bg-particles span:nth-child(5)  { left: 40%; animation-duration: 24s; animation-delay:  3s;   width: 4px; height: 4px; }
.bg-particles span:nth-child(6)  { left: 50%; animation-duration: 17s; animation-delay:  5s;   width: 6px; height: 6px; }
.bg-particles span:nth-child(7)  { left: 58%; animation-duration: 21s; animation-delay:  0.5s; width: 3px; height: 3px; background: var(--accent); }
.bg-particles span:nth-child(8)  { left: 65%; animation-duration: 19s; animation-delay:  2.5s; width: 5px; height: 5px; }
.bg-particles span:nth-child(9)  { left: 73%; animation-duration: 23s; animation-delay:  1.5s; width: 4px; height: 4px; }
.bg-particles span:nth-child(10) { left: 80%; animation-duration: 15s; animation-delay:  4.5s; width: 3px; height: 3px; }
.bg-particles span:nth-child(11) { left: 88%; animation-duration: 18s; animation-delay:  3.5s; width: 5px; height: 5px; background: var(--accent); }
.bg-particles span:nth-child(12) { left: 95%; animation-duration: 20s; animation-delay:  0.8s; width: 4px; height: 4px; }
.bg-particles span:nth-child(13) { left: 15%; animation-duration: 25s; animation-delay:  6s;   width: 3px; height: 3px; }
.bg-particles span:nth-child(14) { left: 45%; animation-duration: 16s; animation-delay:  7s;   width: 5px; height: 5px; background: var(--accent); }
.bg-particles span:nth-child(15) { left: 70%; animation-duration: 22s; animation-delay:  8s;   width: 4px; height: 4px; }

@keyframes particle-float {
  0%   { bottom: -10%; opacity: 0; transform: translateX(0) scale(0); }
  10%  { opacity: 0.4; transform: scale(1); }
  50%  { opacity: 0.15; transform: translateX(40px); }
  90%  { opacity: 0.3; transform: translateX(-20px); }
  100% { bottom: 110%; opacity: 0; transform: translateX(10px) scale(0); }
}


/* ═══════════════════════════════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════════════════════════════ */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, #0c1a28 0%, var(--bg-deep) 70%);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  animation: splash-entrance 0.8s ease-out;
}

@keyframes splash-entrance {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-icon svg {
  width: 90px;
  height: 90px;
  animation: splash-rotate 8s linear infinite;
  filter: drop-shadow(0 0 20px var(--primary-glow));
}

@keyframes splash-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.splash-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-100);
  margin-top: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.splash-subtitle {
  font-size: 0.95rem;
  color: var(--text-300);
  margin-top: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.splash-loader {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  margin: 2rem auto 0;
  overflow: hidden;
}

.splash-loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  animation: splash-load 2.5s ease-in-out forwards;
}

@keyframes splash-load {
  0%   { width: 0%; }
  60%  { width: 70%; }
  100% { width: 100%; }
}


/* ═══════════════════════════════════════════════════════════════════
   APP CONTAINER
   ═══════════════════════════════════════════════════════════════════ */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  animation: app-fadein 0.6s ease-out;
}

@keyframes app-fadein {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 1.5rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.header-logo h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-100);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.header-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(32, 201, 151, 0.1);
  border: 1px solid rgba(32, 201, 151, 0.2);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.15rem;
}


/* ═══════════════════════════════════════════════════════════════════
   STEPPER
   ═══════════════════════════════════════════════════════════════════ */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.4;
  transition: var(--transition);
}

.step.active {
  opacity: 1;
}

.step.completed {
  opacity: 0.8;
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid var(--text-400);
  color: var(--text-300);
  transition: var(--transition);
}

.step.active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

.step.completed .step-circle {
  background: rgba(32, 201, 151, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.step span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-300);
  white-space: nowrap;
}

.step.active span {
  color: var(--text-100);
}

.step-line {
  flex: 1;
  height: 1px;
  background: var(--text-400);
  margin: 0 0.5rem;
  min-width: 20px;
  opacity: 0.3;
}


/* ═══════════════════════════════════════════════════════════════════
   GLASS CARD
   ═══════════════════════════════════════════════════════════════════ */
.card.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

/* Step panel visibility */
.step-panel {
  display: none;
}

.step-panel.active-panel {
  display: block;
  animation: panel-enter 0.5s ease-out;
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.card-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-100);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-300);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}


/* ═══════════════════════════════════════════════════════════════════
   UPLOAD ZONE (Drag & Drop)
   ═══════════════════════════════════════════════════════════════════ */
.upload-zone {
  position: relative;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: var(--transition);
  cursor: pointer;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(32, 201, 151, 0.03) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(32, 201, 151, 0.04);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
  opacity: 1;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-icon {
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.upload-zone h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-100);
  margin-bottom: 0.4rem;
}

.upload-zone p {
  font-size: 0.8rem;
  color: var(--text-300);
  line-height: 1.6;
}

.upload-zone .btn-outline {
  position: relative;
  z-index: 3;
  margin-top: 1rem;
}

.upload-zone.has-files {
  border-color: var(--primary);
  border-style: solid;
  background: rgba(32, 201, 151, 0.04);
}

/* File list inside upload zone */
.file-list {
  position: relative;
  z-index: 3;
  margin-top: 0.75rem;
  text-align: left;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  animation: file-slide-in 0.3s ease-out;
}

@keyframes file-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.file-item .file-ext {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(32, 201, 151, 0.12);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.file-item .file-name {
  color: var(--text-200);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-size {
  color: var(--text-400);
  font-size: 0.7rem;
}


/* ═══════════════════════════════════════════════════════════════════
   INFO BOX
   ═══════════════════════════════════════════════════════════════════ */
.info-box {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(13, 202, 240, 0.06);
  border: 1px solid rgba(13, 202, 240, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.info-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.info-box strong {
  color: var(--text-100);
  font-size: 0.85rem;
}

.info-box ul {
  margin: 0.4rem 0 0 1.2rem;
  font-size: 0.8rem;
  color: var(--text-300);
}

.info-box ul li {
  margin-bottom: 0.2rem;
}

.info-box code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(13, 202, 240, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}


/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #17a87c);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid rgba(32, 201, 151, 0.3);
}

.btn-outline:hover {
  background: rgba(32, 201, 151, 0.08);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-300);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-ghost:hover {
  color: var(--text-100);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}


/* ═══════════════════════════════════════════════════════════════════
   PROCESSING ANIMATION (STEP 3)
   ═══════════════════════════════════════════════════════════════════ */
.processing-container {
  text-align: center;
  padding: 2rem 0;
}

.processing-animation {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1.5px solid transparent;
  border-radius: 50%;
}

.ring-1 {
  border-top-color: var(--primary);
  animation: orbit-spin 2s linear infinite;
}

.ring-2 {
  inset: 12px;
  border-right-color: var(--accent);
  animation: orbit-spin 3s linear infinite reverse;
}

.ring-3 {
  inset: 24px;
  border-bottom-color: var(--primary);
  animation: orbit-spin 1.5s linear infinite;
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

.orbit-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px var(--primary-glow);
}

.ring-2 .orbit-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  top: auto;
  bottom: 0;
  right: 0;
  left: auto;
}

.ring-3 .orbit-dot {
  top: auto;
  bottom: 0;
}

.processing-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: core-pulse 2s ease-in-out infinite;
}

@keyframes core-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.9); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

.processing-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-100);
  margin-bottom: 0.5rem;
}

.processing-status {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  margin: 0 auto 1rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.processing-note {
  font-size: 0.75rem;
  color: var(--text-400);
  max-width: 360px;
  margin: 0 auto;
}


/* ═══════════════════════════════════════════════════════════════════
   RESULTS (STEP 4)
   ═══════════════════════════════════════════════════════════════════ */
.results-container {
  text-align: center;
  padding: 1.5rem 0;
}

.results-icon {
  margin-bottom: 1.5rem;
  animation: results-pop 0.6s ease-out;
}

@keyframes results-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.results-icon.error svg circle { stroke: var(--danger); fill: rgba(255, 107, 107, 0.08); }
.results-icon.error svg path   { stroke: var(--danger); d: path("M32 20v14M32 40v2"); }

.results-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-100);
  margin-bottom: 0.5rem;
}

.results-desc {
  font-size: 0.85rem;
  color: var(--text-300);
  margin-bottom: 1.5rem;
}

/* ─── Results Stat Cards ─── */
.results-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(32, 201, 151, 0.06);
  border: 1px solid rgba(32, 201, 151, 0.15);
  border-radius: var(--radius-md);
  min-width: 120px;
  animation: panel-enter 0.5s ease-out;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

.results-files {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
  text-align: left;
}

.result-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  animation: file-slide-in 0.4s ease-out;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.file-icon.shp {
  background: rgba(32, 201, 151, 0.12);
  color: var(--primary);
  border: 1px solid rgba(32, 201, 151, 0.2);
}

.file-icon.xlsx {
  background: rgba(13, 202, 240, 0.12);
  color: var(--accent);
  border: 1px solid rgba(13, 202, 240, 0.2);
}

.result-file strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-100);
}

.result-file span {
  font-size: 0.72rem;
  color: var(--text-400);
}


/* ─── Excel Preview Table ─── */
.excel-preview {
  margin: 1.5rem 0;
  text-align: left;
}

/* ─── Map Preview ─── */
.map-preview {
  margin: 1.5rem 0;
  text-align: left;
}

.map-preview h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-200);
  margin-bottom: 0.75rem;
}

.map-container {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 300px;
}

#map-svg {
  width: 100%;
  height: 400px;
  display: block;
}

#map-svg .tank-polygon {
  fill: rgba(32, 201, 151, 0.25);
  stroke: #20c997;
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.2s, stroke-width 0.2s;
}

#map-svg .tank-polygon:hover {
  fill: rgba(32, 201, 151, 0.5);
  stroke-width: 2.5;
}

#map-svg .tank-centroid {
  fill: #ff6b6b;
  stroke: #fff;
  stroke-width: 1;
  cursor: pointer;
}

#map-svg .tank-label {
  font-size: 9px;
  fill: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  pointer-events: none;
  text-anchor: middle;
}

#map-svg .grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 0.5;
}

#map-svg .axis-label {
  font-size: 8px;
  fill: rgba(255, 255, 255, 0.3);
  font-family: inherit;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.7rem;
  color: var(--text-400);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.legend-polygon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: rgba(32, 201, 151, 0.25);
  border: 2px solid #20c997;
  border-radius: 2px;
  margin-right: 0.25rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #ff6b6b;
  border: 1.5px solid #fff;
  border-radius: 50%;
  margin-right: 0.25rem;
}

.map-tooltip {
  position: absolute;
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(32, 201, 151, 0.3);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  color: var(--text-200);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.excel-preview h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-200);
  margin-bottom: 0.75rem;
}

/* ─── Preview Links (Open in New Tab) ─── */
.preview-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
.preview-link:hover {
  color: var(--primary);
}
.link-arrow {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0.5;
  background: rgba(32,201,151,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(32,201,151,0.15);
  transition: opacity 0.2s, background 0.2s;
}
.preview-link:hover .link-arrow {
  opacity: 1;
  background: rgba(32,201,151,0.15);
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(32,201,151,0.3) rgba(255,255,255,0.04);
}

.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(32,201,151,0.4);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(32,201,151,0.6);
}

.scroll-hint {
  display: block;
  text-align: center;
  font-size: 0.65rem;
  color: var(--primary);
  font-weight: 600;
  padding: 0.4rem 0;
  white-space: nowrap;
  opacity: 0.8;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.table-scroll table {
  width: 100%;
  min-width: 950px;
  border-collapse: collapse;
  font-size: 0.62rem;
}

.table-scroll th {
  background: rgba(32, 201, 151, 0.12);
  color: var(--primary);
  font-weight: 600;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  text-align: center;
}

.table-scroll td {
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-300);
  white-space: nowrap;
  font-size: 0.6rem;
}

.preview-note {
  text-align: center;
  color: var(--text-400) !important;
  font-style: italic;
  padding: 1rem !important;
}



/* ═══════════════════════════════════════════════════════════════════
   STEP 4: PARAMETER SELECTION STYLES
   ═══════════════════════════════════════════════════════════════════ */
.param-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 25, 40, 0.6);
  border: 1px solid rgba(32, 201, 151, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  backdrop-filter: blur(8px);
}

.param-count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(32, 201, 151, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(32, 201, 151, 0.25);
}

.param-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.param-groups-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.param-group {
  background: rgba(20, 30, 48, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.param-group:hover {
  border-color: rgba(32, 201, 151, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.param-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.param-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-100);
  letter-spacing: 0.02em;
}

.param-group-badge {
  font-size: 0.65rem;
  color: var(--text-400);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

.param-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem;
}

.param-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.param-card:hover {
  background: rgba(32, 201, 151, 0.05);
  border-color: rgba(32, 201, 151, 0.3);
  transform: translateY(-1px);
}

.param-card.selected {
  background: rgba(32, 201, 151, 0.09);
  border-color: rgba(32, 201, 151, 0.45);
  box-shadow: 0 0 12px rgba(32, 201, 151, 0.12);
}

.param-checkbox {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.param-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.param-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-100);
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.02em;
}

.param-label {
  font-size: 0.72rem;
  color: var(--text-300);
  line-height: 1.25;
}

.param-desc {
  font-size: 0.63rem;
  color: var(--text-400);
  margin-top: 0.1rem;
}

/* Custom Export Card on Step 5 */
.custom-export-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  margin: 1.2rem 0;
  background: linear-gradient(135deg, rgba(32, 201, 151, 0.08), rgba(13, 202, 240, 0.08));
  border: 1px solid rgba(32, 201, 151, 0.25);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.custom-export-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.custom-export-icon {
  font-size: 1.6rem;
  background: rgba(32, 201, 151, 0.15);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(32, 201, 151, 0.3);
}

.custom-export-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-100);
  margin-bottom: 0.15rem;
}

.custom-export-info span {
  font-size: 0.72rem;
  color: var(--text-300);
}

.custom-export-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.app-footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.75rem;
  color: var(--text-400);
}

.app-footer p {
  opacity: 0.7;
}


/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .app-container {
    padding: 0.75rem;
  }

  .card.glass {
    padding: 1.25rem;
  }

  .stepper {
    padding: 0.5rem 0.6rem;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .step span {
    display: none;
  }

  .step-line {
    min-width: 12px;
  }

  .splash-title {
    font-size: 1.5rem;
  }

  .upload-zone {
    padding: 1.5rem 1rem;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    width: 100%;
  }
}
