/* css/components.css — DevKit Component Library for AcadTools */

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp2);
  padding: var(--sp3) var(--sp5);
  border-radius: var(--r2);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition:
    transform var(--t-fast) var(--t-spring),
    box-shadow var(--t-mid) var(--t-ease),
    background var(--t-mid) var(--t-ease),
    opacity var(--t-fast) var(--t-ease),
    border-color var(--t-mid) var(--t-ease);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--t-mid) var(--t-ease);
}

.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--acid-halo); }

/* Primary — Acid Green */
.btn-primary {
  background: var(--acid);
  color: #000;
  box-shadow: 0 0 0 0 var(--acid-glow);
}
.btn-primary:hover {
  box-shadow: var(--shadow-acid), 0 4px 20px var(--acid-glow);
  color: #000;
}

/* Secondary — Outline Acid */
.btn-secondary {
  background: transparent;
  color: var(--acid);
  border: 1.5px solid rgba(0,255,178,0.3);
}
.btn-secondary:hover {
  background: var(--acid-halo);
  border-color: var(--acid);
  color: var(--acid);
}

/* Ghost */
.btn-ghost {
  background: var(--raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--border-glow);
  color: var(--bright);
  border-color: var(--border-glow);
}

/* Plasma — Violet */
.btn-plasma {
  background: var(--plasma);
  color: #fff;
  box-shadow: 0 0 0 0 var(--plasma-glow);
}
.btn-plasma:hover {
  box-shadow: var(--shadow-plasma);
  background: var(--plasma-dim);
  color: #fff;
}

/* Danger */
.btn-danger {
  background: transparent;
  color: #FF4757;
  border: 1.5px solid rgba(255,71,87,0.3);
}
.btn-danger:hover {
  background: rgba(255,71,87,0.1);
  border-color: #FF4757;
  color: #FF4757;
}

/* Icon Button */
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--r2);
  background: var(--raised);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-icon:hover {
  color: var(--acid);
  border-color: rgba(0,255,178,0.3);
  background: var(--acid-halo);
}

/* Sizes */
.btn-sm  { padding: var(--sp2) var(--sp4); font-size: 12px; }
.btn-lg  { padding: var(--sp4) var(--sp8); font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp3); align-items: center; }

/* Loading State */
.btn.loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.loading::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Success Pulse */
.btn-success-state {
  animation: successPulse 0.5s var(--t-spring);
}
@keyframes successPulse {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0,255,178,0.6); }
  50%  { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(0,255,178,0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,255,178,0); }
}

/* ═══════════════════════════════════════
   FORM INPUTS
═══════════════════════════════════════ */
.form-group, .field-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp2);
  margin-bottom: var(--sp5);
}

.form-label, .field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-input, .field-input, input[type="text"], input[type="email"],
input[type="password"], input[type="number"], input[type="tel"],
input[type="search"], input[type="url"], textarea, select {
  width: 100%;
  background: var(--deep);
  border: 1.5px solid var(--border);
  border-radius: var(--r2);
  padding: var(--sp3) var(--sp4);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--bright);
  outline: none;
  transition:
    border-color var(--t-mid) var(--t-ease),
    box-shadow var(--t-mid) var(--t-ease),
    background var(--t-mid) var(--t-ease);
  -webkit-appearance: none;
  appearance: none;
}

/* Force native dropdown list to dark mode across all browsers */
select {
  color-scheme: dark;
}
select option,
select optgroup {
  background: #0d1117;
  color: #e2e8f0;
}
select option:checked,
select option:hover {
  background: #1a2332;
  color: #ffffff;
}

.form-input::placeholder, .field-input::placeholder,
input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

.form-input:hover, input:hover, textarea:hover { border-color: var(--border-glow); }

.form-input:focus, .field-input:focus, input:focus, textarea:focus, select:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px var(--acid-halo), 0 0 12px rgba(0,255,178,0.1);
  background: rgba(0,255,178,0.02);
}

/* States */
.form-input.invalid, .field-input.error, input.error {
  border-color: #FF4757;
  box-shadow: 0 0 0 3px rgba(255,71,87,0.1);
}
.form-input.valid, .field-input.success, input.success {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px var(--acid-halo);
}

.form-error, .field-error-msg {
  font-size: 11px;
  color: #FF4757;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-helper, .field-helper { font-size: 11px; color: var(--muted); }

/* Textarea */
textarea, .field-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}

/* Select */
select, .field-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238892A0' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Toggle Switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  cursor: pointer;
}

.toggle {
  width: 44px; height: 24px;
  background: var(--raised);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  position: relative;
  transition: background var(--t-mid) var(--t-ease), border-color var(--t-mid) var(--t-ease);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle.on { background: rgba(0,255,178,0.15); border-color: var(--acid); }

.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--t-mid) var(--t-spring), background var(--t-mid) var(--t-ease);
}
.toggle.on::after { transform: translateX(20px); background: var(--acid); }

.toggle-label { font-size: 13px; color: var(--text); cursor: pointer; }

/* Float Label */
.float-label-wrap { position: relative; margin-top: var(--sp5); }
.float-label {
  position: absolute;
  top: 12px; left: 14px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  transition: all var(--t-mid) var(--t-ease);
}
.float-input {
  padding: 18px 14px 6px;
}
.float-input:focus + .float-label,
.float-input:not(:placeholder-shown) + .float-label {
  top: 5px;
  font-size: 10px;
  color: var(--acid);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Shake Animation */
.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
  10%, 90% { transform: translate3d(-1px,0,0); }
  20%, 80% { transform: translate3d(2px,0,0); }
  30%, 50%, 70% { transform: translate3d(-4px,0,0); }
  40%, 60% { transform: translate3d(4px,0,0); }
}

/* Custom Checkbox */
.custom-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  cursor: pointer;
}
.custom-checkbox-wrapper input[type="checkbox"] { display: none; }
.checkbox-box {
  width: 20px; height: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--r1);
  background: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-mid) var(--t-ease);
}
.custom-checkbox-wrapper input[type="checkbox"]:checked + .checkbox-box {
  background: rgba(0,255,178,0.15);
  border-color: var(--acid);
}
.custom-checkbox-wrapper input[type="checkbox"]:checked + .checkbox-box::after {
  content: '✓';
  color: var(--acid);
  font-size: 12px;
  font-weight: 700;
}

/* ═══════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  padding: var(--sp1) var(--sp3);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.status-success { background: rgba(0,255,178,0.1); color: var(--acid); border: 1px solid rgba(0,255,178,0.2); }
.status-error   { background: rgba(255,71,87,0.1); color: #FF4757; border: 1px solid rgba(255,71,87,0.2); }
.status-warning { background: rgba(245,166,35,0.1); color: var(--gold); border: 1px solid rgba(245,166,35,0.2); }
.status-info    { background: rgba(56,189,248,0.1); color: var(--ice); border: 1px solid rgba(56,189,248,0.2); }

/* ═══════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════ */
.toast-container {
  position: fixed;
  right: var(--sp6);
  bottom: var(--sp6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp3);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: var(--sp3) var(--sp4);
  border-radius: var(--r2);
  border: 1px solid;
  font-size: 13px;
  animation: toastIn 0.4s var(--t-spring);
  position: relative;
  overflow: hidden;
  min-width: 280px;
  max-width: 420px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: rgba(0,255,178,0.06); border-color: rgba(0,255,178,0.2); color: var(--bright); }
.toast-success::before { background: var(--acid); }
.toast-error   { background: rgba(255,71,87,0.06); border-color: rgba(255,71,87,0.2); color: var(--bright); }
.toast-error::before { background: #FF4757; }
.toast-warning { background: rgba(245,166,35,0.06); border-color: rgba(245,166,35,0.2); color: var(--bright); }
.toast-warning::before { background: var(--gold); }
.toast-info    { background: rgba(56,189,248,0.06); border-color: rgba(56,189,248,0.2); color: var(--bright); }
.toast-info::before { background: var(--ice); }

.toast-icon  { font-size: 15px; }
.toast-msg   { flex: 1; }
.toast-close { color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; transition: color var(--t-fast); }
.toast-close:hover { color: var(--bright); }

/* ═══════════════════════════════════════
   LOADING STATES
═══════════════════════════════════════ */
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border-glow);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--raised) 25%, var(--border-glow) 50%, var(--raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r1);
  height: 14px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--raised);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acid), var(--plasma));
  border-radius: 100px;
  position: relative;
  animation: progressGlow 2s ease-in-out infinite alternate;
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: -2px;
  width: 8px; height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}
@keyframes progressGlow {
  from { box-shadow: 0 0 6px rgba(0,255,178,0.4); }
  to   { box-shadow: 0 0 16px rgba(0,255,178,0.8); }
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--sp6);
  transition: border-color var(--t-mid) var(--t-ease), box-shadow var(--t-mid) var(--t-ease);
}
.card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-md); }

.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: var(--sp5);
  cursor: pointer;
  transition:
    transform var(--t-mid) var(--t-spring),
    border-color var(--t-mid) var(--t-ease),
    box-shadow var(--t-mid) var(--t-ease);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cat-color, var(--acid)), transparent);
  opacity: 0;
  transition: opacity var(--t-mid) var(--t-ease);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-glow);
  border-color: var(--border-glow);
  text-decoration: none;
}
.tool-card:hover::before { opacity: 1; }

.tool-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--r2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: var(--sp4);
  background: var(--raised);
  transition: transform var(--t-mid) var(--t-spring);
}
.tool-card:hover .tool-card-icon { transform: scale(1.1) rotate(-5deg); }

.tool-card-name, .tool-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--bright);
  margin-bottom: var(--sp2);
  letter-spacing: -0.01em;
}

.tool-card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: var(--sp4);
}

.tool-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  border: 1px solid;
}

/* Category color sets */
.cat-format { --cat-color: var(--cat-format); }
.cat-encode  { --cat-color: var(--cat-encode); }
.cat-gen     { --cat-color: var(--cat-generate); }
.cat-opt     { --cat-color: var(--cat-optimize); }
.cat-calc    { --cat-color: var(--acid); }

.cat-format .tool-card-icon { background: rgba(0,255,178,0.1); }
.cat-encode .tool-card-icon  { background: rgba(124,106,255,0.1); }
.cat-gen .tool-card-icon     { background: rgba(56,189,248,0.1); }
.cat-opt .tool-card-icon     { background: rgba(255,107,53,0.1); }
.cat-calc .tool-card-icon    { background: rgba(0,255,178,0.1); }

.cat-format .tool-card-tag { color: var(--cat-format); border-color: rgba(0,255,178,0.3);   background: rgba(0,255,178,0.08); }
.cat-encode .tool-card-tag  { color: var(--cat-encode); border-color: rgba(124,106,255,0.3); background: rgba(124,106,255,0.08); }
.cat-gen .tool-card-tag     { color: var(--cat-generate); border-color: rgba(56,189,248,0.3); background: rgba(56,189,248,0.08); }
.cat-opt .tool-card-tag     { color: var(--cat-optimize); border-color: rgba(255,107,53,0.3); background: rgba(255,107,53,0.08); }
.cat-calc .tool-card-tag    { color: var(--acid); border-color: rgba(0,255,178,0.3); background: rgba(0,255,178,0.08); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp4);
}

/* Tool grid alias */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp5); }

/* Component card (inner panels) */
.component-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  overflow: hidden;
  transition: border-color var(--t-mid) var(--t-ease);
}
.component-card:hover { border-color: var(--border-glow); }
.component-card-header {
  padding: var(--sp4) var(--sp5);
  background: var(--raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp3);
}
.component-card-title { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--bright); }
.component-card-body  { padding: var(--sp6); display: flex; flex-direction: column; gap: var(--sp5); }

/* ═══════════════════════════════════════
   NAVIGATION — GradeKit Category Style
═══════════════════════════════════════ */
.navbar {
  background: rgba(8,11,15,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}
.navbar.scrolled {
  background: rgba(8,11,15,0.98);
  box-shadow: 0 2px 24px rgba(0,0,0,0.4);
}

.nav-container {
  display: flex;
  align-items: center;
  height: 64px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sp8);
  gap: 0;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: var(--sp4);
}
.nav-logo:hover { text-decoration: none; opacity: 1; }
.nav-logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--acid), var(--plasma));
  border-radius: var(--r2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #000;
}
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.03em;
}
.nav-logo-text span { color: var(--acid); }

/* Category Nav */
.nav-cats {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
  height: 64px;
}

.nav-cat {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  padding: var(--sp3) var(--sp4);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  border-radius: var(--r2);
  transition: color var(--t-mid), background var(--t-mid);
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  height: 100%;
  align-self: stretch;
  align-items: center;
}
.nav-cat:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); text-decoration: none; }
.nav-cat.active { color: #fff; }
.nav-cat.active .nav-cat-underline { opacity: 1; }

.nav-cat-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-cat-underline {
  position: absolute;
  bottom: 0; left: var(--sp4); right: var(--sp4);
  height: 2px;
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transition: opacity var(--t-mid);
}

/* Category Dropdown — Mega menu */
.nav-cat-wrap {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
}
.nav-cat-wrap:hover .nav-mega-dropdown,
.nav-cat-wrap:focus-within .nav-mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--r3);
  min-width: 480px;
  padding: var(--sp4);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t-mid) var(--t-ease), transform var(--t-mid) var(--t-ease), visibility var(--t-mid);
  z-index: 200;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp2);
}
.nav-mega-dropdown.single-col { grid-template-columns: 1fr; min-width: 260px; }

.dd-item {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  padding: var(--sp3) var(--sp3);
  border-radius: var(--r2);
  cursor: pointer;
  transition: background var(--t-mid);
  text-decoration: none;
}
.dd-item:hover { background: var(--raised); text-decoration: none; }
.dd-icon {
  width: 36px; height: 36px;
  border-radius: var(--r2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.dd-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--bright);
  margin-bottom: 1px;
}
.dd-desc { font-size: 11px; color: var(--muted); }

/* Nav Right */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp2);
  flex-shrink: 0;
}

.auth-buttons {
  display: flex;
  gap: var(--sp2);
  align-items: center;
}

/* Simple nav-menu (for non-category pages like About, Contact) */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0;
  margin: 0;
  padding: 0;
  height: 64px;
}
.nav-item { position: relative; height: 64px; display: flex; align-items: center; }
.nav-link {
  padding: var(--sp3) var(--sp4);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  border-radius: var(--r2);
  transition: color var(--t-mid), background var(--t-mid);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp2);
  text-decoration: none;
  height: 64px;
}
.nav-link:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); text-decoration: none; }
.nav-link.active { color: var(--acid); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: var(--sp4); right: var(--sp4);
  height: 2px;
  background: var(--acid);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px var(--acid);
}

/* Simple dropdown (non-category pages) */
.nav-dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--r3);
  min-width: 220px;
  list-style: none;
  padding: var(--sp2) 0;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--t-mid) var(--t-ease);
  z-index: 200;
  margin: 0;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu li a {
  display: block;
  padding: var(--sp2) var(--sp5);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast);
}
.dropdown-menu li a:hover { color: var(--bright); background: var(--raised); text-decoration: none; }

/* Hamburger */
.hamburger { display: none; cursor: pointer; z-index: 1001; padding: var(--sp2); }
.hamburger .bar {
  display: block; width: 24px; height: 2px;
  margin: 5px auto;
  transition: all 0.3s ease;
  background: var(--muted); border-radius: 2px;
}
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════
   FOOTER — 5-Column GradeKit Style
═══════════════════════════════════════ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: var(--sp20);
}

/* 5-column footer grid */
.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp12) var(--sp8) var(--sp10);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: var(--sp8);
  border-bottom: 1px solid var(--border);
}

/* Col 1: Brand */

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  text-decoration: none;
  margin-bottom: var(--sp4);
}
.footer-logo:hover { opacity: 0.9; text-decoration: none; }
.footer-logo-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--acid), var(--plasma));
  border-radius: var(--r1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 14px; font-weight: 800; color: #000;
}
.footer-logo-text {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--white); letter-spacing: -0.02em;
}
.footer-logo-text span { color: var(--acid); }
.footer-desc {
  color: var(--muted); font-size: 13px; line-height: 1.7;
  margin-bottom: var(--sp5); max-width: 220px;
}

/* Social buttons */
.footer-social { display: flex; gap: var(--sp2); margin-bottom: var(--sp5); }
.footer-social-btn {
  width: 32px; height: 32px;
  border-radius: var(--r2);
  background: var(--raised);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer;
  color: var(--muted);
  transition: background var(--t-mid), border-color var(--t-mid), color var(--t-mid);
  text-decoration: none;
}
.footer-social-btn:hover { background: var(--border-glow); border-color: var(--border-glow); color: var(--bright); text-decoration: none; }

/* Newsletter */
.footer-newsletter {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: var(--sp4);
}
.footer-nl-title { font-size: 12px; font-weight: 600; color: var(--bright); margin-bottom: 2px; }
.footer-nl-sub   { font-size: 11px; color: var(--muted); margin-bottom: var(--sp3); }
.footer-nl-row   { display: flex; gap: var(--sp2); }
.footer-nl-input {
  flex: 1;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  padding: 7px 10px;
  font-size: 12px; color: var(--bright);
  outline: none;
  font-family: var(--font-body);
  transition: border-color var(--t-mid);
}
.footer-nl-input::placeholder { color: var(--muted); opacity: 0.5; }
.footer-nl-input:focus { border-color: var(--acid); }

/* Tool columns */

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  margin-bottom: var(--sp4);
  display: flex;
  align-items: center;
  gap: var(--sp2);
}
.footer-col-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: var(--sp2);
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 3px 0;
  text-decoration: none;
  transition: color var(--t-mid);
  line-height: 1.5;
}
.footer-link:hover { color: rgba(255,255,255,0.9); text-decoration: none; }
.footer-link-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.5;
}

/* Footer bottom */
.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp5) var(--sp8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp3);
}
.footer-bottom-left {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  font-family: var(--font-mono);
}
.footer-bottom-left span { color: var(--acid); }
.footer-bottom-right {
  display: flex;
  gap: var(--sp5);
}
.footer-bottom-link {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  text-decoration: none;
  transition: color var(--t-mid);
}
.footer-bottom-link:hover { color: rgba(255,255,255,0.6); text-decoration: none; }

/* Legacy compat: old footer-content still works */
.footer-content {
  max-width: 1400px; margin: 0 auto;
  padding: var(--sp12) var(--sp8) var(--sp8);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--sp8);
  border-bottom: 1px solid var(--border);
}
.footer-col h4 {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--acid); margin-bottom: var(--sp4);
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: var(--sp2); }
.footer-links a { color: var(--muted); font-size: 13px; text-decoration: none; transition: color var(--t-mid); }
.footer-links a:hover { color: var(--bright); text-decoration: none; }

/* ═══════════════════════════════════════
   HERO SECTION
═══════════════════════════════════════ */
.hero-section {
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: var(--sp24) 0;
  background: transparent;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  background: rgba(0,255,178,0.08);
  border: 1px solid rgba(0,255,178,0.2);
  padding: var(--sp2) var(--sp4);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--acid);
  letter-spacing: 0.1em;
  margin-bottom: var(--sp6);
  animation: fadeSlideUp 0.6s var(--t-ease) both;
}
.hero-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acid);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: var(--sp6);
  animation: fadeSlideUp 0.7s 0.1s var(--t-ease) both;
}
.hero-title .line1 { color: var(--white); display: block; }
.hero-title .line2 {
  display: block;
  background: linear-gradient(135deg, var(--acid) 0%, var(--plasma) 50%, var(--ice) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: var(--sp8);
  animation: fadeSlideUp 0.7s 0.2s var(--t-ease) both;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp3);
  animation: fadeSlideUp 0.7s 0.3s var(--t-ease) both;
}

/* Terminal Mockup */
.hero-terminal {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  background: var(--panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--r4);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-acid);
  animation: fadeSlideLeft 0.8s 0.3s var(--t-ease) both;
}
.terminal-bar {
  background: var(--raised);
  padding: var(--sp3) var(--sp4);
  display: flex;
  align-items: center;
  gap: var(--sp3);
  border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.td-red    { background: #FF5F57; }
.td-yellow { background: #FFBD2E; }
.td-green  { background: #28CA41; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  margin-right: auto;
}
.terminal-body {
  padding: var(--sp5);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.8;
}
.t-green  { color: #00FFB2; }
.t-blue   { color: #38BDF8; }
.t-purple { color: #7C6AFF; }
.t-orange { color: #FF6B35; }
.t-dim    { color: #4A5568; }
.t-white  { color: #E8F0F8; }
.t-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--acid);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ═══════════════════════════════════════
   PAGE PANELS (auth, settings, profile)
═══════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp12) var(--sp5);
  background: var(--void);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border-glow);
  border-radius: var(--r4);
  padding: var(--sp10) var(--sp8);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.page-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r4);
  overflow: hidden;
}

.page-panel-header {
  padding: var(--sp5) var(--sp6);
  background: var(--raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp4);
}

.page-panel-body { padding: var(--sp6); }

/* Stats Section */
.stats-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--sp12) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp8);
  text-align: center;
}

.stat-val {
  font-family: var(--font-display);
  font-size: clamp(36px,5vw,56px);
  font-weight: 800;
  color: var(--acid);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--sp2);
}

.stat-lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

/* Spec Notes */
.spec-note {
  background: var(--panel);
  border-left: 2px solid var(--acid);
  padding: var(--sp4) var(--sp5);
  border-radius: 0 var(--r2) var(--r2) 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  margin-top: var(--sp4);
}
.spec-note strong { color: var(--bright); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1100px) {
  .hero-terminal { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: var(--sp6); }
  .footer-brand { grid-column: 1 / -1; }
  .nav-cats { gap: 0; }
  .nav-mega-dropdown { min-width: 360px; }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr; gap: var(--sp6); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .tools-grid, .tool-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-cats {
    display: none;
    position: fixed;
    top: 64px; left: 0;
    width: 100%; height: calc(100vh - 64px);
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp6);
    gap: var(--sp2);
    transition: left 0.3s var(--t-ease);
    z-index: 99;
    overflow-y: auto;
    height: auto;
  }
  .nav-cats.open { display: flex; }
  .nav-cat-wrap { width: 100%; height: auto; flex-direction: column; align-items: flex-start; }
  .nav-cat { width: 100%; height: auto; padding: var(--sp3) var(--sp4); }
  .nav-mega-dropdown {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    background: var(--raised); box-shadow: none;
    border: 1px solid var(--border); border-radius: var(--r2);
    margin-top: var(--sp2); min-width: unset; width: 100%;
    grid-template-columns: 1fr;
    display: none;
  }
  .nav-mega-dropdown.open { display: grid; }
  .nav-menu {
    position: fixed;
    top: 64px; left: -100%;
    width: 100%; height: calc(100vh - 64px);
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp6);
    gap: var(--sp2);
    transition: left 0.3s var(--t-ease);
    z-index: 99; overflow-y: auto;
  }
  .nav-menu.open { left: 0; }
  .nav-item { width: 100%; height: auto; }
  .nav-link { width: 100%; height: auto; padding: var(--sp3) var(--sp4); }
  .dropdown-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    background: var(--raised); box-shadow: none;
    border: 1px solid var(--border); border-radius: var(--r2); margin-top: var(--sp2);
  }
  .hamburger { display: block; }
  .auth-buttons { gap: var(--sp2); }
  .footer-content { grid-template-columns: 1fr; }
  .auth-card { padding: var(--sp6) var(--sp5); }
}

@media (max-width: 480px) {
  .tools-grid, .tool-grid { grid-template-columns: 1fr; }
  .hero-cta-row { flex-direction: column; }
  .hero-section { min-height: auto; padding: var(--sp16) 0; }
  .footer-grid { grid-template-columns: 1fr; }
}