/* ══════════════════════════════════════════════════════════
   Phishing Detector — Dark Cybersecurity Theme
   ══════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-primary:      #0d1117;
  --bg-card:         #161b22;
  --bg-card-hover:   #1c2128;
  --border:          #30363d;
  --accent-danger:   #ff4444;
  --accent-safe:     #00c853;
  --accent-warn:     #f59e0b;
  --accent-blue:     #58a6ff;
  --text-primary:    #e6edf3;
  --text-muted:      #8b949e;
  --font-main:       'Inter', system-ui, sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
  --radius:          8px;
  --radius-sm:       4px;
  --transition:      0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}

.shield-icon { font-size: 20px; }
.brand-en  { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.brand-sep { color: var(--border); }
.brand-ar  { font-size: 14px; color: var(--text-muted); }

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text-primary); text-decoration: none; }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.lang-toggle:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-decoration: none;
}

/* ── Flash messages ── */
.flash-container {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 24px;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 8px;
  font-size: 14px;
}

.flash-danger  { background: rgba(255,68,68,0.1);  border-color: var(--accent-danger); color: var(--accent-danger); }
.flash-success { background: rgba(0,200,83,0.1);   border-color: var(--accent-safe);   color: var(--accent-safe);   }
.flash-warning { background: rgba(245,158,11,0.1); border-color: var(--accent-warn);   color: var(--accent-warn);   }

/* ── Main content ── */
.main-content {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

/* ── Page header ── */
.page-header { margin-bottom: 24px; text-align: center; }

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-tagline {
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Cards ── */
.main-card { }   /* semantic modifier — inherits all .card styles */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  font-weight: 500;
}

/* ── Tab panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Form controls ── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-main);
  transition: border-color var(--transition);
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

.mono-input { font-family: var(--font-mono); font-size: 13px; }

/* ── File drop zone ── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--accent-blue);
  background: rgba(88,166,255,0.05);
}

.drop-icon { font-size: 32px; margin-bottom: 12px; }

.drop-text {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-name-display {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-blue);
  margin-top: 8px;
}

/* ── Buttons ── */
.btn-analyze {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-blue);
  color: #0d1117;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-analyze:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  text-decoration: none;
  color: #0d1117;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-main);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-decoration: none;
}

/* ── CTA row ── */
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-bottom: 16px;
}

/* ── Verdict banner ── */
.verdict-banner {
  border-radius: var(--radius);
  padding: 28px 32px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid;
}

.verdict-icon { font-size: 36px; margin-bottom: 8px; }

.verdict-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.verdict-conf { font-size: 16px; }

.verdict-phishing {
  background: rgba(255,68,68,0.1);
  border-color: var(--accent-danger);
  color: var(--accent-danger);
  box-shadow: 0 0 20px rgba(255,68,68,0.2);
}

.verdict-benign {
  background: rgba(0,200,83,0.1);
  border-color: var(--accent-safe);
  color: var(--accent-safe);
  box-shadow: 0 0 20px rgba(0,200,83,0.2);
}

/* ── Risk score bar ── */
.risk-card { padding: 20px 24px; }

.risk-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.risk-pct { color: var(--text-primary); font-weight: 600; }

.risk-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-primary);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.risk-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #00c853 0%, #f59e0b 50%, #ff4444 100%);
  background-size: 100% 100%;
  transition: width 0.5s ease;
}

.risk-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Auth-adjusted notice ── */
.auth-adjusted-notice {
  background: rgba(88,166,255,0.08);
  border: 1px solid rgba(88,166,255,0.3);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--accent-blue);
  margin-bottom: 20px;
}

/* ── Auth alert strip ── */
.auth-alert {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 28px;
  border-radius: var(--radius);
  border: 1px solid;
}

.auth-alert-fail {
  background: rgba(255, 68, 68, 0.08);
  border-color: var(--accent-danger);
  box-shadow: 0 0 18px rgba(255, 68, 68, 0.15);
}

.auth-alert-pass {
  background: rgba(0, 200, 83, 0.08);
  border-color: var(--accent-safe);
  box-shadow: 0 0 18px rgba(0, 200, 83, 0.15);
}

.auth-alert-neutral {
  background: rgba(88, 166, 255, 0.06);
  border-color: var(--accent-blue);
  box-shadow: 0 0 18px rgba(88, 166, 255, 0.10);
}

.auth-alert-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-alert-icon { font-size: 20px; }

.auth-alert-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-alert-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-pass    { background: rgba(0,200,83,0.15);    color: var(--accent-safe);   border: 1px solid rgba(0,200,83,0.35);    }
.badge-fail    { background: rgba(255,68,68,0.15);   color: var(--accent-danger); border: 1px solid rgba(255,68,68,0.35);   }
.badge-unknown { background: rgba(139,148,158,0.10); color: var(--text-muted);    border: 1px solid var(--border);          }

/* ── Meta card ── */
.meta-card { }

.meta-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.meta-row:last-child { border-bottom: none; }

.meta-key {
  flex: 0 0 100px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
  padding-top: 2px;
}

.meta-val { flex: 1; color: var(--text-primary); font-size: 14px; }
.meta-val.mono { font-family: var(--font-mono); font-size: 13px; }

/* ── URL list ── */
.url-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.url-plain {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  /* NOT a link — plain text only for safety */
  cursor: text;
  user-select: all;
}

/* ── Feature table ── */
.features-card { }

.top5-note {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  background: rgba(255,68,68,0.1);
  border: 1px solid rgba(255,68,68,0.2);
  padding: 2px 8px;
  border-radius: 99px;
}

.feature-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.feature-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.feature-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(48,54,61,0.5);
}

.feature-table tr:nth-child(even) td { background: rgba(22,27,34,0.5); }

.top5-row td {
  border-left: 3px solid var(--accent-danger);
  background: rgba(255,68,68,0.04) !important;
}

.feat-idx { color: var(--text-muted); width: 36px; }
.feat-name { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.top5-name { color: var(--accent-danger); }
.feat-val  { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); text-align: right; }

/* ── History table ── */
.history-card { padding: 0; overflow: hidden; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.history-table th {
  padding: 12px 16px;
  background: var(--bg-primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.history-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(48,54,61,0.5);
  vertical-align: middle;
}

.row-phishing td { border-left: 2px solid var(--accent-danger); }
.row-benign  td  { border-left: 2px solid var(--accent-safe);   }

.history-table tr:nth-child(even) td { background: rgba(22,27,34,0.6); }
.history-table tr:hover td { background: var(--bg-card-hover); }

.hist-time    { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.hist-sender  { font-family: var(--font-mono); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-subject { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Mode badge ── */
.mode-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mode-raw    { background: rgba(88,166,255,0.15); color: var(--accent-blue); }
.mode-eml    { background: rgba(245,158,11,0.15); color: var(--accent-warn); }
.mode-form   { background: rgba(139,148,158,0.15); color: var(--text-muted); }

/* ── Verdict chips ── */
.verdict-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chip-phishing { background: rgba(255,68,68,0.15); color: var(--accent-danger); border: 1px solid rgba(255,68,68,0.3); }
.chip-benign   { background: rgba(0,200,83,0.15);  color: var(--accent-safe);   border: 1px solid rgba(0,200,83,0.3);  }

/* ── Inline history confidence bar ── */
.hist-conf-cell { min-width: 100px; }

.hist-conf-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hist-conf-pct { font-size: 12px; font-family: var(--font-mono); }

.hist-conf-bar {
  height: 4px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: 60px;
}

.hist-conf-fill {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
}

.fill-danger { background: var(--accent-danger); }
.fill-safe   { background: var(--accent-safe);   }

/* ── Auth chips (history table) ── */
.auth-chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.chip-pass { background: rgba(0,200,83,0.15);  color: var(--accent-safe);   border: 1px solid rgba(0,200,83,0.3);  }
.chip-fail { background: rgba(255,68,68,0.15); color: var(--accent-danger); border: 1px solid rgba(255,68,68,0.3); }
.chip-na   { background: rgba(139,148,158,0.1); color: var(--text-muted);   border: 1px solid var(--border); }

/* ── Recomputed features notice ── */
.recomputed-notice {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px;
  color: var(--accent-warn);
  margin-bottom: 14px;
}

/* ── History entry cards (replaces table rows) ── */
.history-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}

.history-entry:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  text-decoration: none;
  color: var(--text-primary);
}

.entry-phishing { border-left: 3px solid var(--accent-danger); }
.entry-benign   { border-left: 3px solid var(--accent-safe);   }

.entry-verdict {
  flex: 0 0 110px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.entry-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entry-sender {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-subject {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.entry-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.entry-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.entry-arrow {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--transition);
}

.history-entry:hover .entry-arrow { color: var(--accent-blue); }

@media (max-width: 600px) {
  .history-entry { flex-wrap: wrap; }
  .entry-verdict { flex: 0 0 100%; flex-direction: row; gap: 12px; }
  .entry-right   { display: none; }
}

/* ── History detail page ── */
.detail-id {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 400;
}

.detail-snippet {
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

/* ── No data ── */
.no-data {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Guide page (rendered markdown) ── */
.guide-content {
  line-height: 1.75;
  font-size: 14px;
}

/* Headings */
.guide-content h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-blue);
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
  margin: 32px 0 16px;
}

.guide-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 28px 0 14px;
}

.guide-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 22px 0 10px;
}

.guide-content h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0 8px;
}

/* Paragraphs & spacing */
.guide-content p { margin-bottom: 12px; color: var(--text-primary); }

.guide-content ul,
.guide-content ol {
  padding-left: 24px;
  margin-bottom: 12px;
}

.guide-content li { margin-bottom: 4px; color: var(--text-primary); }

/* Blockquotes (used for notes) */
.guide-content blockquote {
  border-left: 3px solid var(--accent-blue);
  margin: 12px 0;
  padding: 10px 16px;
  background: rgba(88,166,255,0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Inline code */
.guide-content code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(139,148,158,0.1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  color: var(--accent-blue);
}

/* Code blocks */
.guide-content pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.guide-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--text-primary);
}

/* Tables */
.guide-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}

.guide-content thead th {
  background: var(--bg-primary);
  padding: 8px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.guide-content tbody td {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(48,54,61,0.5);
  color: var(--text-primary);
  vertical-align: top;
}

.guide-content tbody tr:nth-child(even) td {
  background: rgba(22,27,34,0.5);
}

/* Horizontal rule */
.guide-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* Strong / em */
.guide-content strong { color: var(--text-primary); font-weight: 600; }
.guide-content em     { color: var(--text-muted); }

/* Emoji state badges: ✅ ⚠️ 🚨 — cells containing these get subtle coloring */
.guide-content td:first-child {
  font-weight: 500;
  white-space: nowrap;
}

/* ── Utility ── */
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }

/* ── Theme toggle button ── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.theme-toggle:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   LIGHT MODE — Professional Cybersecurity Theme
   ═══════════════════════════════════════════════════════════ */

[data-theme="light"] {
  --bg-primary:    #2d3436;
  --bg-card:       #ffffff;
  --bg-card-hover: #f3f4f6;
  --border:        #d0d7de;
  --accent-danger: #cf222e;
  --accent-safe:   #1a7f37;
  --accent-warn:   #9a6700;
  --accent-blue:   #0969da;
  --text-primary:  #1f2328;
  --text-muted:    #636c76;
}

/* Body */
[data-theme="light"] body { color: var(--text-primary); }

/* Cards — subtle shadow instead of glow */
[data-theme="light"] .card {
  box-shadow: 0 1px 3px rgba(31,35,40,0.08);
}

/* ── Navbar stays dark for professional contrast ── */
[data-theme="light"] .navbar {
  background: #24292f;
  border-bottom-color: #1c2128;
}
[data-theme="light"] .navbar-brand { color: #e6edf3; }
[data-theme="light"] .navbar-brand:hover { color: #ffffff; text-decoration: none; }
[data-theme="light"] .navbar .nav-link { color: #8b949e; }
[data-theme="light"] .navbar .nav-link:hover { color: #e6edf3; }
[data-theme="light"] .navbar .lang-toggle { border-color: #444c56; color: #8b949e; }
[data-theme="light"] .navbar .lang-toggle:hover { border-color: #58a6ff; color: #58a6ff; }
[data-theme="light"] .navbar .theme-toggle { border-color: #444c56; color: #8b949e; }
[data-theme="light"] .navbar .theme-toggle:hover { border-color: #58a6ff; color: #58a6ff; }

/* Footer */
[data-theme="light"] .site-footer {
  background: #f6f8fa;
  border-top-color: #d0d7de;
}

/* ── Verdict banners ── */
[data-theme="light"] .verdict-phishing {
  background: #ffebe9;
  border-color: #cf222e;
  color: #cf222e;
  box-shadow: 0 2px 12px rgba(207,34,46,0.12);
}
[data-theme="light"] .verdict-benign {
  background: #dafbe1;
  border-color: #1a7f37;
  color: #1a7f37;
  box-shadow: 0 2px 12px rgba(26,127,55,0.12);
}

/* ── Risk bar ── */
[data-theme="light"] .risk-bar-track {
  background: #eaeef2;
  border-color: #d0d7de;
}

/* ── Auth adjusted notice ── */
[data-theme="light"] .auth-adjusted-notice {
  background: #ddf4ff;
  border-color: rgba(9,105,218,0.3);
  color: #0550ae;
}

/* ── Recomputed notice ── */
[data-theme="light"] .recomputed-notice {
  background: #fff8c5;
  border-color: rgba(154,103,0,0.3);
  color: #9a6700;
}

/* ── Auth alert strip (light theme) ── */
[data-theme="light"] .auth-alert-fail    { background: #ffebe9; border-color: #cf222e; box-shadow: 0 0 12px rgba(207,34,46,0.10); }
[data-theme="light"] .auth-alert-pass    { background: #dafbe1; border-color: #1a7f37; box-shadow: 0 0 12px rgba(26,127,55,0.10); }
[data-theme="light"] .auth-alert-neutral { background: #ddf4ff; border-color: #0969da; box-shadow: none; }
[data-theme="light"] .auth-alert-title   { color: #636c76; }
[data-theme="light"] .badge-pass    { background: #dafbe1; color: #1a7f37; border-color: rgba(26,127,55,0.35); }
[data-theme="light"] .badge-fail    { background: #ffebe9; color: #cf222e; border-color: rgba(207,34,46,0.35); }
[data-theme="light"] .badge-unknown { background: #f6f8fa; color: #636c76; border-color: #d0d7de; }

/* ── Auth chips (history) ── */
[data-theme="light"] .chip-pass {
  background: #dafbe1; color: #1a7f37; border-color: rgba(26,127,55,0.35);
}
[data-theme="light"] .chip-fail {
  background: #ffebe9; color: #cf222e; border-color: rgba(207,34,46,0.35);
}
[data-theme="light"] .chip-na {
  background: #f6f8fa; color: #636c76; border-color: #d0d7de;
}

/* ── Verdict chips ── */
[data-theme="light"] .chip-phishing {
  background: #ffebe9; color: #cf222e; border-color: rgba(207,34,46,0.35);
}
[data-theme="light"] .chip-benign {
  background: #dafbe1; color: #1a7f37; border-color: rgba(26,127,55,0.35);
}

/* ── Flash messages ── */
[data-theme="light"] .flash-danger  { background: #ffebe9; color: #cf222e; border-color: #cf222e; }
[data-theme="light"] .flash-success { background: #dafbe1; color: #1a7f37; border-color: #1a7f37; }
[data-theme="light"] .flash-warning { background: #fff8c5; color: #9a6700; border-color: #d4a72c; }

/* ── Tabs ── */
[data-theme="light"] .tab-bar { border-bottom-color: #d0d7de; }
[data-theme="light"] .tab-btn { color: #636c76; }
[data-theme="light"] .tab-btn:hover { color: #1f2328; }
[data-theme="light"] .tab-btn.active { color: #0969da; border-bottom-color: #0969da; }

/* ── Form controls ── */
[data-theme="light"] .form-control {
  background: #ffffff;
  border-color: #d0d7de;
  color: #1f2328;
}
[data-theme="light"] .form-control:focus {
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9,105,218,0.12);
}
[data-theme="light"] .form-control::placeholder { color: #8c959f; }

/* ── File drop zone ── */
[data-theme="light"] .file-drop-zone { border-color: #d0d7de; }
[data-theme="light"] .file-drop-zone:hover,
[data-theme="light"] .file-drop-zone.drag-over {
  border-color: #0969da;
  background: rgba(9,105,218,0.04);
}

/* ── Buttons ── */
[data-theme="light"] .btn-analyze { background: #0969da; color: #ffffff; }
[data-theme="light"] .btn-analyze:hover { opacity: 0.88; color: #ffffff; }
[data-theme="light"] .btn-secondary { border-color: #d0d7de; color: #636c76; }
[data-theme="light"] .btn-secondary:hover { border-color: #0969da; color: #0969da; }

/* ── Feature table ── */
[data-theme="light"] .feature-table th { border-bottom-color: #d0d7de; color: #636c76; }
[data-theme="light"] .feature-table td { border-bottom-color: #eaeef2; }
[data-theme="light"] .feature-table tr:nth-child(even) td { background: #f6f8fa; }
[data-theme="light"] .top5-row td {
  border-left-color: #cf222e;
  background: #fff0ee !important;
}
[data-theme="light"] .feat-name { color: #636c76; }
[data-theme="light"] .feat-val  { color: #1f2328; }
[data-theme="light"] .top5-name { color: #cf222e; }
[data-theme="light"] .top5-note {
  background: rgba(207,34,46,0.07);
  border-color: rgba(207,34,46,0.2);
  color: #cf222e;
}

/* ── Mode badges ── */
[data-theme="light"] .mode-raw  { background: #ddf4ff; color: #0550ae; }
[data-theme="light"] .mode-eml  { background: #fff8c5; color: #9a6700; }
[data-theme="light"] .mode-form { background: #f6f8fa;  color: #636c76; }

/* ── History entries ── */
[data-theme="light"] .history-entry {
  box-shadow: 0 1px 3px rgba(31,35,40,0.07);
}
[data-theme="light"] .history-entry:hover {
  border-color: #0969da;
  background: #f6f8fa;
}
[data-theme="light"] .entry-phishing { border-left-color: #cf222e; }
[data-theme="light"] .entry-benign   { border-left-color: #1a7f37; }

/* ── RTL in light mode ── */
[data-theme="light"] [dir="rtl"] .top5-row td { border-left: none; border-right: 3px solid #cf222e; }

/* ── Guide content ── */
[data-theme="light"] .guide-content h1 { color: #0969da; border-bottom-color: #d0d7de; }
[data-theme="light"] .guide-content h2 { border-bottom-color: #eaeef2; }
[data-theme="light"] .guide-content h3 { color: #0969da; }
[data-theme="light"] .guide-content blockquote {
  border-left-color: #0969da;
  background: rgba(9,105,218,0.05);
  color: #636c76;
}
[data-theme="light"] .guide-content code {
  background: #eaeef2;
  border-color: #d0d7de;
  color: #0969da;
}
[data-theme="light"] .guide-content pre {
  background: #f6f8fa;
  border-color: #d0d7de;
}
[data-theme="light"] .guide-content pre code { color: #1f2328; }
[data-theme="light"] .guide-content thead th {
  background: #f6f8fa;
  border-bottom-color: #d0d7de;
  color: #636c76;
}
[data-theme="light"] .guide-content tbody td { border-bottom-color: #eaeef2; }
[data-theme="light"] .guide-content tbody tr:nth-child(even) td { background: #f6f8fa; }
[data-theme="light"] .guide-content hr { border-top-color: #d0d7de; }
[data-theme="light"] .guide-content strong { color: #1f2328; }

/* ── Detail page ── */
[data-theme="light"] .detail-snippet { color: #636c76; }
[data-theme="light"] .detail-id { color: #636c76; }
[data-theme="light"] .url-plain {
  background: #f6f8fa;
  color: #636c76;
}

/* ── Page header text on dark-gray background ── */
[data-theme="light"] .page-title  { color: #e6edf3; }
[data-theme="light"] .page-tagline { color: #b2bec3; }

/* ── Confidence bar track inside white cards ── */
[data-theme="light"] .hist-conf-bar { background: #eaeef2; }

/* ── Feature table header inside white cards ── */
[data-theme="light"] .feature-table th { background: #f6f8fa; }

/* ── RTL overrides ── */
[dir="rtl"] .tab-bar              { flex-direction: row-reverse; }
[dir="rtl"] .tab-btn              { border-bottom: 2px solid transparent; border-top: none; }
[dir="rtl"] .tab-btn.active       { border-bottom-color: var(--accent-blue); }
[dir="rtl"] .navbar-inner         { flex-direction: row-reverse; }
[dir="rtl"] .navbar-actions       { flex-direction: row-reverse; }
[dir="rtl"] .auth-alert           { flex-direction: row-reverse; }
[dir="rtl"] .auth-alert-badges   { flex-direction: row-reverse; }
[dir="rtl"] .meta-key             { text-align: right; }
[dir="rtl"] .feature-table th,
[dir="rtl"] .feature-table td,
[dir="rtl"] .history-table th,
[dir="rtl"] .history-table td     { text-align: right; }
[dir="rtl"] .top5-row td          { border-left: none; border-right: 3px solid var(--accent-danger); }
[dir="rtl"] .row-phishing td      { border-left: none; border-right: 2px solid var(--accent-danger); }
[dir="rtl"] .row-benign td        { border-left: none; border-right: 2px solid var(--accent-safe);   }
[dir="rtl"] .feat-val             { text-align: left; }
[dir="rtl"] .cta-row              { flex-direction: row-reverse; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .main-content { padding: 20px 16px; }
  .page-title   { font-size: 22px; }
  .tab-btn      { padding: 8px 12px; font-size: 13px; }
  .card         { padding: 16px; }
  .verdict-text { font-size: 20px; }
  .history-table th,
  .history-table td { padding: 8px 10px; }
  .hist-sender,
  .hist-subject { max-width: 120px; }
}

@media (max-width: 480px) {
  .brand-ar, .brand-sep { display: none; }
  .tab-bar { gap: 0; }
  .tab-btn { flex: 1; text-align: center; padding: 8px 4px; font-size: 12px; }
}

/* ══════════════════════════════════════════════════════════
   Auth Pages — Cards, CAPTCHA, Password Strength
   ══════════════════════════════════════════════════════════ */

/* ── Auth layout ── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px - 48px);   /* minus navbar + footer */
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 0 24px rgba(88, 166, 255, 0.12);
}

/* ── Auth header ── */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-shield {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ── Form fields ── */
.auth-field {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition);
}

.auth-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.auth-input::placeholder { color: var(--text-muted); }

/* number input — hide spinners */
.auth-input[type="number"]::-webkit-outer-spin-button,
.auth-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.auth-input[type="number"] { -moz-appearance: textfield; }

/* ── Submit button ── */
.auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: var(--accent-blue);
  color: #0d1117;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
}

.auth-submit:hover { opacity: 0.88; }

/* ── Switch link ── */
.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-switch a { color: var(--accent-blue); }

/* ── CAPTCHA terminal box ── */
.captcha-box {
  background: #0a0f0a;
  border: 1px solid #00c853;
  border-radius: var(--radius-sm);
  color: #00c853;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 0 10px rgba(0, 200, 83, 0.18);
  margin-bottom: 6px;
  user-select: none;
}

/* Keep captcha dark even in light mode */
[data-theme="light"] .captcha-box {
  background: #0a0f0a;
  color: #00c853;
  border-color: #00c853;
}

.captcha-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.captcha-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.captcha-input { flex: 1; }

.captcha-refresh-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition);
}

.captcha-refresh-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.captcha-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Password strength bar ── */
.pw-strength {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.pw-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pw-strength-label {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
  min-height: 16px;
}

/* ── Navbar user/logout ── */
.nav-user {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 4px;
  white-space: nowrap;
}

.nav-logout {
  font-size: 13px;
  color: var(--accent-danger);
  cursor: pointer;
  white-space: nowrap;
}

.nav-logout:hover {
  color: #ff6666;
  text-decoration: underline;
}

/* ── Light theme overrides for auth card ── */
[data-theme="light"] .auth-card {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .auth-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .auth-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

[data-theme="light"] .auth-label { color: #64748b; }
[data-theme="light"] .auth-title { color: #1e293b; }

[data-theme="light"] .captcha-refresh-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

[data-theme="light"] .captcha-refresh-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

[data-theme="light"] .pw-strength { background: #e2e8f0; }

/* ── Auth mobile ── */
@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
  .nav-user  { display: none; }
}
