/* === Waiver Optimizer — Mobile-first Static Site === */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --maroon: #881A3C;
  --maroon-dark: #5C1028;
  --gold: #FFC107;
  --gold-light: #FFF8E1;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
  color: white;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(136, 26, 60, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-text { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.accent-text { font-weight: 800; }

/* ── Container ────────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero-section { margin-bottom: 24px; }
.hero-content { text-align: center; margin-bottom: 20px; }
.hero-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--maroon), #c2185b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
}

/* ── Glass Card ───────────────────────────────────────── */
.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}
.glass-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ── Upload Zone ──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 16px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--maroon);
  background: #fdf2f8;
}
.upload-icon { font-size: 2.2rem; margin-bottom: 8px; }
.upload-zone h3 { font-size: 1rem; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.upload-zone p { font-size: 0.85rem; color: var(--text-muted); }

/* ── Controls ─────────────────────────────────────────── */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 480px) {
  .controls-grid { grid-template-columns: 1fr; }
}
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.input-group input, .input-group select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--maroon);
  background: white;
}

/* ── Primary Button ───────────────────────────────────── */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { box-shadow: 0 4px 18px rgba(136, 26, 60, 0.35); transform: translateY(-1px); }
.btn-primary:disabled { 
  background: #cbd5e1; 
  color: #64748b; 
  cursor: not-allowed; 
  transform: none; 
  box-shadow: none;
}
.btn-primary.pulse { animation: pulse-glow 1.5s infinite; }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(136, 26, 60, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(136, 26, 60, 0); }
}

/* ── Status / Error ───────────────────────────────────── */
.status-message {
  font-size: 0.82rem;
  text-align: center;
  margin-top: 10px;
  font-weight: 500;
}
.error-card {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  color: #991b1b;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 16px;
}
.error-icon { font-size: 1.4rem; }

/* ── Loader ───────────────────────────────────────────── */
.loader-container {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 30px;
}
.loader {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--maroon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-container p { font-size: 0.88rem; color: var(--text-muted); font-weight: 500; }

/* ── Results ──────────────────────────────────────────── */
.results-dashboard { opacity: 0; transition: opacity 0.4s ease; }
.results-dashboard.visible { opacity: 1; }
.results-header { margin-bottom: 16px; }
.results-header h2 { font-size: 1.3rem; font-weight: 800; }

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 400px) { .metrics-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } }

.metric-card {
  text-align: center;
  padding: 14px 8px;
  margin-bottom: 0;
}
.metric-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 4px;
}
.metric-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}
.accent-card h2 { color: var(--maroon); }
.total-card {
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border-color: #f9a8d4;
}
.total-card h2 { color: #be185d; }

/* ── Table ────────────────────────────────────────────── */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
thead th {
  background: var(--gold);
  padding: 10px;
  text-align: left;
  font-weight: 700;
  color: #1e293b;
  font-size: 0.72rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }

/* Badges */
.category-badge {
  padding: 2px 7px; border-radius: 5px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
}
.theme-Core { background: #fdf2f8; color: var(--maroon); }
.theme-Elective { background: #d1fae5; color: #065f46; }
.theme-Practical { background: #fef3c7; color: #92400e; }

/* Star / Priority */
.priority-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; color: #cbd5e1; transition: all 0.2s;
}
.priority-btn:hover { color: #f59e0b; border-color: #f59e0b; background: #fffbeb; transform: scale(1.1); }
.priority-btn.active { color: #f59e0b; border-color: #f59e0b; background: #fef3c7; box-shadow: 0 0 6px rgba(245,158,11,0.4); }

.priority-row-highlight {
  background-color: #fffbeb !important;
  outline: 2px solid #fde68a;
  outline-offset: -2px;
}
.priority-row-highlight td {
  border-bottom-color: transparent !important;
}

#recalculateBtn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
}
#recalculateBtn:hover:not(:disabled) {
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}
#recalculateBtn:disabled {
  background: #cbd5e1;
  color: #64748b;
  outline: none;
  box-shadow: none;
}

/* ── Benchmarks ───────────────────────────────────────── */
.benchmarks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 400px) { .benchmarks-grid { grid-template-columns: repeat(2, 1fr); } }

.benchmark-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.78rem;
  position: relative;
}
.benchmark-card.optimal {
  border-color: var(--maroon);
  background: #fdf2f8;
  padding-top: 18px;
}
.optimal-tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--maroon); color: white;
  font-size: 0.6rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; white-space: nowrap;
}
.benchmark-label { display: block; font-weight: 700; color: var(--text-muted); }
.benchmark-marks { display: block; font-size: 1.1rem; font-weight: 800; color: var(--text); margin: 2px 0; }
.benchmark-pct { display: block; color: #94a3b8; font-size: 0.72rem; }

/* ── Schedule Header Row ──────────────────────────────── */
.schedule-header-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.schedule-header-row h3 { margin-bottom: 0; }
.csv-icon-btn {
  background: white; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text);
  padding: 6px 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; font-size: 0.85rem; font-weight: 600; font-family: inherit; transition: all 0.2s;
}
.csv-icon-btn:hover { background: var(--bg); transform: scale(1.02); }

/* Waiver Notice */
.waiver-notice {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 500;
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px dashed #7dd3fc;
  text-align: center;
  margin-bottom: 12px;
}

/* ── Hint Box ─────────────────────────────────────────── */
.hint-box {
  padding: 12px 24px;
  background: var(--bg);
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
  margin: 16px 0 0;
}
.hint-box strong { color: var(--maroon); }

.priority-warning {
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
  animation: shake 0.3s ease-in-out;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: 20px;
  font-size: 0.85rem;
  color: #94a3b8;
  border-top: 1px solid var(--border);
  position: relative;
}
.footer a {
  color: var(--maroon);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.footer a:hover {
  text-decoration: underline;
}

/* ── Floating Buttons ─────────────────────────────────── */
.floating-btn {
  position: fixed;
  z-index: 999;
  border: none;
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.new-upload-btn {
  bottom: 24px;
  right: 24px;
  background: var(--card);
  color: var(--maroon);
  border: 1px solid var(--border);
}
.feedback-btn {
  top: 80px;
  left: 16px;
  background: white;
  color: #0f172a;
  border: 1px solid var(--border);
}
@media (max-width: 480px) {
  .new-upload-btn { bottom: 16px; right: 16px; padding: 10px 14px; }
  .feedback-btn { top: 60px; left: 10px; padding: 10px 14px; }
  .feedback-popup { top: 110px; left: 10px; }
}

.feedback-popup {
  position: fixed;
  top: 130px;
  left: 16px;
  width: 250px;
  z-index: 1000;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.feedback-popup h4 {
  font-size: 0.95rem; margin-bottom: 8px; color: var(--maroon);
}
.feedback-popup p {
  font-size: 0.8rem; margin-bottom: 6px;
}
.feedback-popup a {
  color: var(--maroon); text-decoration: underline;
}

/* ── Custom Tooltip for Easter Egg ── */
.custom-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: #1e293b;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px);
}
.custom-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

/* ── Modal ────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none !important; }
.modal-content {
  background: var(--card);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-content h2 { margin-bottom: 12px; font-size: 1.3rem; font-weight: 800; }
.modal-content p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.subject-credit-row {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.subject-credit-row h4 { font-size: 0.95rem; margin-bottom: 8px; color: var(--maroon); }
.credit-inputs {
  display: flex;
  gap: 10px;
}
.credit-inputs .input-group { flex: 1; }

/* ── How to find it Section (Modal) ────────────────── */
.how-to-section {
  margin-top: 16px;
  position: relative;
}
.how-to-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: help;
  padding: 4px 8px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.how-to-header:hover {
  border-color: var(--maroon);
  color: var(--maroon);
}
.how-to-header svg {
  color: var(--maroon);
}

.how-to-steps {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: none;
  gap: 12px;
  margin-bottom: 10px;
  z-index: 10;
  animation: fadeInDown 0.2s ease-out;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.how-to-header:hover + .how-to-steps,
.how-to-steps:hover {
  display: flex !important;
}

.step-item {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.step-num {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--maroon);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  line-height: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}
.step-item p {
  margin: 0 !important;
  font-weight: 600;
}

.rules-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.rules-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ── Rules Modal ─────────────────────────────────────── */
.rules-modal-content {
  max-width: 550px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.modal-header h2 { margin-bottom: 0; }
.close-btn {
  background: none; border: none;
  font-size: 1.5rem; color: var(--text-muted);
  cursor: pointer; padding: 4px;
  line-height: 1;
}
.close-btn:hover { color: var(--maroon); }

.rules-body {
  display: flex; flex-direction: column; gap: 20px;
}
.rule-item {
  display: flex; gap: 16px;
}
.rule-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--maroon); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 800;
}
.rule-text strong {
  display: block; font-size: 1rem; color: var(--text); margin-bottom: 4px;
}
.rule-text p {
  font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5;
}
.rule-text p:last-of-type { margin-bottom: 0; }
.rule-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff8e1;
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  font-size: 0.82rem;
  color: #854d0e;
  line-height: 1.5;
}
.rule-note strong { color: #854d0e; font-size: 0.82rem; display: inline; }
.rule-note em { font-style: italic; }
.rule-example strong { display: inline; }

.rule-example {
  margin-top: 12px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.example-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.example-table th {
  background: var(--bg); padding: 6px 10px; text-align: left;
  font-weight: 700; font-size: 0.72rem; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.example-table td {
  padding: 6px 10px; border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem; color: var(--text); font-weight: 500;
}
.example-table tr:last-child td { border-bottom: none; }

.rules-disclaimer {
  margin-top: 8px;
  padding: 12px;
  background: #fff1f2;
  border: 1px dashed #fda4af;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #9f1239;
  text-align: center;
}
.rules-disclaimer strong { color: #9f1239; }

/* ── Mobile Tweaks ────────────────────────────────────── */
@media (max-width: 480px) {
  .logo-text { font-size: 1.1rem; }
  .rules-btn { font-size: 0.72rem; padding: 6px 10px; }
  .rule-item { gap: 10px; }
  .rule-text strong { font-size: 0.9rem; }
  .rule-text p { font-size: 0.85rem; }
}

/* ── Utility ──────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Mobile tweaks ────────────────────────────────────── */
@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.25rem; }
  .metric-card h2 { font-size: 1.2rem; }
  .glass-card { padding: 14px; }
  .upload-zone { padding: 20px 12px; }
}
