/* Import Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Color Palette - Dark Mode */
  --bg-gradient: radial-gradient(circle at top, #1e293b 0%, #0f172a 50%, #020617 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --primary: #d4b08a;
  --primary-hover: #b8865c;
  --primary-glow: rgba(212, 176, 138, 0.2);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --card-bg: rgba(30, 41, 59, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: #0f172a;
  --input-border: #334155;
  
  /* Semantic Badges */
  --badge-best-bg: rgba(34, 197, 94, 0.15);
  --badge-best-text: #4ade80;
  --badge-best-border: rgba(34, 197, 94, 0.3);
  --badge-fast-bg: rgba(245, 158, 11, 0.15);
  --badge-fast-text: #fbbf24;
  --badge-fast-border: rgba(245, 158, 11, 0.3);
}

/* Base resets & fonts */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  padding: 30px;
  min-height: 100vh;
  transition: background 0.35s, color 0.35s;
  position: relative;
  overflow-x: hidden;
}

/* Light Mode Overrides */
.light-mode {
  --bg-gradient: radial-gradient(circle at top, #f8fafc 0%, #f1f5f9 60%, #e2e8f0 100%);
  --text-main: #0f172a;
  --text-muted: #475569;
  
  --primary: #8b5a2b;
  --primary-hover: #70441e;
  --primary-glow: rgba(139, 90, 43, 0.15);
  --border-color: rgba(15, 23, 42, 0.08);
  
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(15, 23, 42, 0.08);
  --input-bg: #f8fafc;
  --input-border: #cbd5e1;
  
  --badge-best-bg: rgba(22, 163, 74, 0.1);
  --badge-best-text: #15803d;
  --badge-best-border: rgba(22, 163, 74, 0.25);
  --badge-fast-bg: rgba(217, 119, 6, 0.1);
  --badge-fast-text: #b45309;
  --badge-fast-border: rgba(217, 119, 6, 0.25);
}

/* Ambient glow blobs in dark mode */
body::before,
body::after {
  content: "";
  position: fixed;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: -1;
  animation: drift 15s infinite alternate;
}

body::before { top: -100px; right: -50px; background: var(--primary); }
body::after { bottom: -150px; left: -50px; background: #64748b; }
.light-mode::before, .light-mode::after { display: none; }

/* Hero Card styling */
.hero-card {
  text-align: center;
  margin-bottom: 28px;
  padding: 36px 28px;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: floatIn 0.6s ease;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

header h1 {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

header .lead {
  font-size: 16px;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto 12px;
  line-height: 1.6;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.hero-badges span {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Info Grid / Introduction Cards */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.mini-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mini-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.mini-card h3 {
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
}

.mini-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Main Simulator Flex Containers */
.main-flex {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 36px;
}

/* Controls Panel */
.controls-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.controls-panel h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: 0.5px;
}

.param-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.3s ease;
}

.param-group.hidden {
  display: none !important;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
}

input, select {
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  background: var(--input-bg);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input[type="range"] {
  cursor: pointer;
  padding: 0;
  height: 6px;
  background: var(--input-border);
  border: none;
}

/* Button & Button Group styling */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

button {
  padding: 11px 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  color: white;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px var(--primary-glow);
  font-family: inherit;
  flex: 1 1 calc(50% - 4px);
  min-width: 100px;
}

button:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px var(--primary-glow);
  filter: brightness(1.05);
}

button:active {
  transform: scale(0.98);
}

#resetBtn {
  background: #475569;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.15);
}
#resetBtn:hover {
  background: #334155;
  box-shadow: 0 6px 16px rgba(71, 85, 105, 0.2);
}

#themeBtn {
  background: #64748b;
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.15);
}
#themeBtn:hover {
  background: #475569;
  box-shadow: 0 6px 16px rgba(100, 116, 139, 0.2);
}

/* P6: Export buttons styling */
.export-group {
  margin-top: 4px;
}

.export-btn {
  background: linear-gradient(135deg, #0f766e, #14b8a6) !important;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2) !important;
  font-size: 12px !important;
}

.export-btn:hover {
  filter: brightness(1.1);
}

.export-btn:disabled {
  background: #334155 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Warehouse Container & Gate */
.warehouse-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  width: 100%;
}

.shipping-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: var(--card-bg);
  border: 1px dashed var(--primary);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Warehouse Section & Grid Layout */
.warehouse-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-heading {
  text-align: center;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 13px;
}

#warehouse {
  display: grid;
  grid-template-columns: repeat(5, 92px);
  gap: 12px;
  justify-content: center;
  padding: 18px;
  border-radius: 24px;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  perspective: 1000px;
  transform-style: preserve-3d;
}

#warehouse.running {
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 20px rgba(212, 176, 138, 0.15);
  animation: rackStage 1.4s ease-in-out infinite alternate;
}

/* Racks Cell Styling based on Priorities */
.cell {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  /* Fallback color if priority classes aren't yet added */
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

/* Priority Gradations - Clear representation of weights 1-6 */
.cell.priority-1 {
  background: linear-gradient(135deg, #334155, #1e293b);
  border-color: rgba(71, 85, 105, 0.3);
}
.cell.priority-2 {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-color: rgba(14, 165, 233, 0.35);
}
.cell.priority-3 {
  background: linear-gradient(135deg, #10b981, #047857);
  border-color: rgba(16, 185, 129, 0.35);
}
.cell.priority-4 {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  border-color: rgba(234, 179, 8, 0.35);
}
.cell.priority-5 {
  background: linear-gradient(135deg, #f97316, #c2410c);
  border-color: rgba(249, 115, 22, 0.35);
}
.cell.priority-6 {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.cell:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.cell .rack-label {
  font-size: 20px;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.cell .rack-tag {
  position: absolute;
  bottom: 8px;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

/* Dynamic Active moving style during simulation run */
#warehouse.running .cell.active {
  animation: cellMove 0.7s cubic-bezier(.4, 1.5, .6, 1) infinite alternate;
}

#warehouse.running .cell:nth-child(2n) { animation-delay: 0.1s; }
#warehouse.running .cell:nth-child(3n) { animation-delay: 0.2s; }
#warehouse.running .cell:nth-child(4n) { animation-delay: 0.3s; }
#warehouse.running .cell:nth-child(5n) { animation-delay: 0.4s; }

/* Status / Progress Indicator Section */
.generation-section {
  max-width: 800px;
  margin: 28px auto 24px;
  text-align: center;
  padding: 16px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

.panel-title-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

#generationText {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.status-badge {
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #475569;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.running {
  background: #16a34a;
}

.status-badge.idle {
  background: #64748b;
}

.progress-wrap {
  width: 100%;
  background: var(--input-bg);
  border-radius: 99px;
  overflow: hidden;
  height: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, var(--primary));
  transition: width 0.2s ease;
}

.status-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Statistics Panels cards styling */
.stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
  border-radius: 20px;
  width: 240px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.card p {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.card small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.highlight-card {
  border: 1px solid var(--primary);
  box-shadow: 0 8px 24px var(--primary-glow);
}

/* Chart container styling */
.chart-section {
  max-width: 900px;
  margin: 32px auto;
  text-align: center;
}

canvas {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 20px;
  max-width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: background 0.3s;
}

.light-mode canvas {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.08);
}

/* Results Display & Summary cards */
.result-section {
  max-width: 980px;
  margin: 36px auto;
  text-align: center;
}

.best-solution-card {
  margin: 16px auto 24px;
  max-width: 760px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 18px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  line-height: 1.6;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.result-table th, .result-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.result-table th {
  background: rgba(15, 23, 42, 0.3);
  color: var(--primary);
  font-weight: 700;
}

.light-mode .result-table th {
  background: rgba(15, 23, 42, 0.04);
}

/* B.5 Metrics Section (Comparative grid of rank cards) */
.metrics-section {
  max-width: 1000px;
  margin: 36px auto;
  text-align: center;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  text-align: left;
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
}

.metric-card h3 {
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.metric-desc {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.metric-ranking {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border-color);
}

.light-mode .metric-row {
  background: rgba(15, 23, 42, 0.03);
}

.metric-row.winner {
  background: linear-gradient(135deg, rgba(212, 176, 138, 0.15), rgba(212, 176, 138, 0.05));
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(212, 176, 138, 0.08);
}

.rank-medal {
  font-size: 18px;
  flex-shrink: 0;
}

.rank-algo {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}

.rank-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

/* Badges styling */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-best {
  background: var(--badge-best-bg);
  color: var(--badge-best-text);
  border: 1px solid var(--badge-best-border);
}

.badge-fast {
  background: var(--badge-fast-bg);
  color: var(--badge-fast-text);
  border: 1px solid var(--badge-fast-border);
}

.layout-cell {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 200px;
  word-break: break-all;
}

/* ============================================================
   P3: SA Monitor Panel Styles
   ============================================================ */
.sa-monitor-section {
  max-width: 900px;
  margin: 28px auto;
  text-align: center;
}

.sa-monitor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.sa-monitor-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px 16px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, border-color 0.3s ease;
}

.sa-monitor-card:hover {
  transform: translateY(-3px);
}

.sa-monitor-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.sa-monitor-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sa-monitor-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.sa-monitor-card.accepted-yes {
  border-color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.15);
}

.sa-monitor-card.accepted-no {
  border-color: #64748b;
}

/* ============================================================
   P5 & P8: Educational Section Styles
   ============================================================ */
.edu-section {
  max-width: 1000px;
  margin: 40px auto;
  text-align: center;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px 22px;
  text-align: left;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.edu-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.edu-card h3 {
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.edu-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.edu-card.formula-card {
  grid-column: span 2;
  text-align: center;
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(212, 176, 138, 0.06), rgba(212, 176, 138, 0.02));
}

.formula-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px auto;
  max-width: 500px;
}

.formula-line {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.formula-label {
  color: var(--primary);
  font-weight: 800;
}

.formula-line code {
  background: rgba(15, 23, 42, 0.3);
  padding: 4px 12px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  border: 1px solid var(--border-color);
}

.light-mode .formula-line code {
  background: rgba(15, 23, 42, 0.06);
}

.edu-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.edu-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

.edu-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
  padding-left: 20px;
}

.edu-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* ============================================================
   P7: Performance Summary Styles
   ============================================================ */
.performance-summary-section {
  max-width: 1000px;
  margin: 36px auto;
  text-align: center;
}

.perf-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.perf-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px 16px;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  transition: transform 0.25s ease;
}

.perf-card:hover {
  transform: translateY(-4px);
}

.perf-card-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.perf-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.perf-card-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.4;
}

.perf-card-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Responsive Overrides */
@media (max-width: 980px) {
  .main-flex {
    flex-direction: column;
    align-items: center;
  }
  .controls-panel {
    width: 100%;
    max-width: 500px;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .sa-monitor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .perf-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .edu-grid {
    grid-template-columns: 1fr;
  }
  .edu-card.formula-card {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }
  header h1 {
    font-size: 28px;
  }
  #warehouse {
    grid-template-columns: repeat(3, 90px);
  }
  .stats {
    flex-direction: column;
    align-items: center;
  }
  .card {
    width: 100%;
    max-width: 300px;
  }
  .sa-monitor-grid {
    grid-template-columns: 1fr;
  }
  .perf-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Animations */
@keyframes floatIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(30px, -20px, 0); }
}

@keyframes cellMove {
  0% { transform: scale(1) translateY(0px) rotateZ(0deg); }
  100% { transform: scale(1.04) translateY(-6px) rotateZ(-1deg); }
}

@keyframes rackStage {
  0% { transform: perspective(1000px) rotateX(0deg); }
  100% { transform: perspective(1000px) rotateX(0.8deg); }
}
