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

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

:root {
  --sidebar-w: 260px;
  --violet:    #7c3aed;
  --violet-2:  #8b5cf6;
  --cyan:      #06b6d4;
  --cyan-2:    #0891b2;
  --cyan-3:    #22d3ee;
  --bg:        #f8fafc;
  --card:      #ffffff;
  --border:    #e5e7eb;
  --ink:       #111827;
  --ink-2:     #374151;
  --ink-3:     #6b7280;
  --green:     #16a34a;  --green-bg:  #dcfce7;
  --red:       #dc2626;  --red-bg:    #fee2e2;
  --amber:     #b45309;  --amber-bg:  #fef3c7;
  --indigo:    #4f46e5;  --indigo-bg: #e0e7ff;
  --r:         1rem;
  --r-sm:      0.5rem;
  --r-xs:      0.375rem;
}

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

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom right, #f8fafc, rgba(250,245,255,0.3), rgba(236,254,255,0.3));
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ─── SIDEBAR ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #000000;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Violet glow blob */
.sidebar-logo::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 256px; height: 256px;
  border-radius: 50%;
  background: rgba(124,58,237,0.3);
  filter: blur(64px);
  pointer-events: none;
}

/* Cyan glow blob */
.sidebar-logo::after {
  content: '';
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  width: 144px; height: 144px;
  border-radius: 50%;
  background: rgba(34,211,238,0.2);
  filter: blur(40px);
  pointer-events: none;
}

.lumen-logo {
  width: 112px;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

.sidebar-logo-wordmark {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: linear-gradient(135deg, #e9d5ff 0%, #a5f3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo-tagline {
  position: relative;
  z-index: 1;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #818cf8;
  margin-top: 2px;
  text-transform: uppercase;
}


.meta-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 8px;
  background: rgba(124,58,237,0.3);
  color: #c4b5fd;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(124,58,237,0.35);
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px 80px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.25);
  font-weight: 600;
  padding: 10px 8px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  position: relative;
  margin: 2px 0;
}

/* Left accent bar animation */
.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(180deg, #8b5cf6, #22d3ee);
  transition: width 0.2s ease;
  border-radius: 0 4px 4px 0;
}

.nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding-left: 20px;
}

.nav-link:hover::before { width: 3px; }

.nav-link.active {
  background: linear-gradient(to right, rgba(147,51,234,0.4), rgba(8,145,178,0.3));
  color: #67e8f9;
  box-shadow: 0 10px 15px -3px rgba(88,28,135,0.2), 0 4px 6px -4px rgba(88,28,135,0.2);
}

.nav-link.active::before { width: 3px; }

.nav-link .nav-icon { font-size: 0.9rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 11px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

/* ─── PAGE WRAPPER ────────────────────────── */
.page-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(to bottom right, #f8fafc, rgba(250,245,255,0.3), rgba(236,254,255,0.3));
}

/* ─── TOPBAR ──────────────────────────────── */
.topbar {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.topbar-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.topbar-app {
  font-size: 0.72rem;
  color: var(--ink-3);
  font-weight: 500;
}

.topbar-title { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.topbar-sub   { font-size: 0.72rem; color: var(--ink-3); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.agent-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  min-width: 160px;
}

.agent-avatar {
  width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* ─── MAIN ────────────────────────────────── */
.main {
  flex: 1;
  padding: 28px 32px;
  max-width: 960px;
  width: 100%;
}

.section-heading { margin-bottom: 20px; }
.section-heading h1 { font-size: 1.35rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.section-heading p  { font-size: 0.84rem; color: var(--ink-3); }

/* ─── UPLOAD ──────────────────────────────── */
.upload-section { display: flex; flex-direction: column; gap: 14px; }

.upload-card {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.10), 0 4px 10px -5px rgba(0,0,0,0.04);
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #7c3aed, #8b5cf6, #06b6d4);
}

.upload-zone {
  padding: 44px 40px;
  text-align: center;
  border: 2px dashed var(--border);
  margin: 20px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--violet-2);
  background: rgba(139,92,246,0.04);
}

.upload-icon { font-size: 2.2rem; margin-bottom: 12px; opacity: 0.5; }

.upload-zone h2 { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.upload-zone p  { color: var(--ink-3); font-size: 0.83rem; margin-bottom: 5px; }

.upload-hint {
  font-size: 0.72rem !important;
  color: var(--ink-3);
  background: var(--bg);
  display: inline-block;
  padding: 3px 12px;
  border-radius: 9999px;
  margin-top: 4px !important;
  border: 1px solid var(--border);
}

.btn-upload {
  margin-top: 16px;
  background: linear-gradient(to right, #7c3aed, #7e22ce);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-upload:hover {
  box-shadow: 0 8px 20px -4px rgba(124,58,237,0.45);
  transform: translateY(-2px);
}

.upload-meta {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.file-badge { font-size: 0.82rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }

.btn-validate {
  background: linear-gradient(to right, #7c3aed, #7e22ce);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-validate:hover {
  box-shadow: 0 8px 20px -4px rgba(124,58,237,0.45);
  transform: translateY(-2px);
}

/* ─── STATE SELECTOR ──────────────────────── */
.state-selector {
  background: var(--card);
  border-radius: 1rem;
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.state-selector:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.10), 0 4px 10px -5px rgba(0,0,0,0.04);
}

.state-selector::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #7c3aed, #8b5cf6, #06b6d4);
}

.state-selector label {
  display: block;
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.state-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  padding: 5px 15px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.pill:hover  { border-color: var(--violet-2); color: var(--violet); background: rgba(139,92,246,0.08); }
.pill.active { background: rgba(139,92,246,0.08); border-color: var(--violet-2); color: var(--violet); font-weight: 600; }

/* ─── DEMO BUTTON ─────────────────────────── */
.demo-section { text-align: center; margin: 2px 0; }

.btn-demo {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-3);
  padding: 10px 22px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-demo:hover { border-color: var(--violet-2); color: var(--violet); background: rgba(139,92,246,0.06); }

/* ─── RESULTS ─────────────────────────────── */
.results-section { animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.results-header {
  background: var(--card);
  border-radius: 1rem;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.results-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.10), 0 4px 10px -5px rgba(0,0,0,0.04);
}

.results-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #7c3aed, #8b5cf6, #06b6d4);
}

.score-ring { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--border); stroke-width: 9; }
.ring-fill {
  fill: none; stroke: var(--green);
  stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 314; stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1), stroke 0.4s;
}

.score-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.score-label span { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--ink); }
.score-label small { font-size: 0.62rem; color: var(--ink-3); }

.results-summary h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.results-summary p  { color: var(--ink-3); font-size: 0.82rem; margin-bottom: 10px; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { padding: 3px 10px; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; }
.badge-pass { background: var(--green-bg);  color: var(--green); }
.badge-fail { background: var(--red-bg);    color: var(--red); }
.badge-warn { background: var(--amber-bg);  color: var(--amber); }
.badge-info { background: var(--indigo-bg); color: var(--indigo); }

/* ─── CHECK CARDS ─────────────────────────── */
.checks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

@media (max-width: 640px) { .checks-grid { grid-template-columns: 1fr; } }

.check-card {
  background: var(--card);
  border-radius: 1rem;
  padding: 15px 17px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.check-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 4px;
}

.check-card.pass::before { background: var(--green); }
.check-card.fail::before { background: var(--red); }
.check-card.warn::before { background: #d97706; }
.check-card.info::before { background: var(--indigo); }

.check-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px -5px rgba(0,0,0,0.10), 0 4px 10px -5px rgba(0,0,0,0.04); }

.check-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.check-icon   { font-size: 0.95rem; flex-shrink: 0; }
.check-title  { font-size: 0.82rem; font-weight: 600; color: var(--ink); flex: 1; line-height: 1.3; }

.check-status {
  font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 9999px; flex-shrink: 0;
}

.pass .check-status { background: var(--green-bg);  color: var(--green); }
.fail .check-status { background: var(--red-bg);    color: var(--red); }
.warn .check-status { background: var(--amber-bg);  color: var(--amber); }
.info .check-status { background: var(--indigo-bg); color: var(--indigo); }

.check-desc { font-size: 0.77rem; color: var(--ink-3); line-height: 1.5; }
.check-more { font-size: 0.7rem; color: var(--violet); margin-top: 6px; font-weight: 500; }

/* ─── DETAIL PANEL ────────────────────────── */
.detail-panel {
  background: var(--card);
  border-radius: 1rem;
  padding: 22px 26px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  position: relative;
  animation: fadeUp 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07);
}

.detail-panel h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; }
.detail-panel p, .detail-panel li { font-size: 0.84rem; color: var(--ink-2); line-height: 1.7; margin-bottom: 6px; }
.detail-panel ul { padding-left: 18px; }

.detail-panel .ref-link {
  display: inline-block; margin-top: 10px;
  font-size: 0.78rem; color: var(--violet);
  text-decoration: none; border-bottom: 1px solid #c4b5fd;
}

.btn-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--ink-3); padding: 5px 10px;
  border-radius: 8px; font-size: 0.75rem; cursor: pointer; transition: all 0.15s;
}

.btn-close:hover { background: var(--red-bg); color: var(--red); border-color: #fca5a5; }

/* ─── ACTIONS ─────────────────────────────── */
.actions-bar { display: flex; gap: 10px; justify-content: flex-end; }

.btn-primary {
  background: linear-gradient(to right, #7c3aed, #7e22ce);
  color: #fff; border: none;
  padding: 12px 22px; border-radius: 12px;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 8px 20px -4px rgba(124,58,237,0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #fff; color: var(--ink-2);
  border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 12px;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
}

.btn-secondary:hover { border-color: var(--violet-2); color: var(--violet); background: rgba(139,92,246,0.06); }

/* ─── SPINNER ─────────────────────────────── */
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(248,250,252,0.85);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(8px);
}

.spinner {
  border: 3px solid #e2e8f0;
  border-top-color: var(--violet-2);
  border-right-color: var(--cyan);
  border-radius: 50%; width: 40px; height: 40px;
  animation: spin 0.8s linear infinite; margin-bottom: 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner-overlay p { color: var(--ink-2); font-size: 0.875rem; }

/* ─── FOOTER ──────────────────────────────── */
.site-footer {
  padding: 18px 32px 28px;
  font-size: 0.72rem; color: var(--ink-3);
  line-height: 1.8; border-top: 1px solid var(--border);
  margin-top: auto; background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}

.site-footer a { color: var(--violet); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ─── HISTORY ─────────────────────────────── */
.history-section { display: flex; flex-direction: column; gap: 14px; }

.history-empty {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 48px 28px;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.88rem;
}

.history-empty .history-empty-icon { font-size: 2rem; margin-bottom: 12px; opacity: 0.4; }

.history-item {
  background: var(--card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.history-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #7c3aed, #8b5cf6, #06b6d4);
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0,0,0,0.10), 0 4px 10px -5px rgba(0,0,0,0.04);
}

.history-score {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700;
  border: 3px solid;
}

.history-score.good  { color: var(--green);  border-color: var(--green);  background: var(--green-bg); }
.history-score.ok    { color: var(--amber);  border-color: var(--amber);  background: var(--amber-bg); }
.history-score.poor  { color: var(--red);    border-color: var(--red);    background: var(--red-bg); }

.history-info { flex: 1; min-width: 0; }
.history-info strong { display: block; font-size: 0.88rem; color: var(--ink); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-info span   { font-size: 0.76rem; color: var(--ink-3); }

.history-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.history-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

.btn-clear-history {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-3);
  padding: 7px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear-history:hover { border-color: #fca5a5; color: var(--red); background: var(--red-bg); }

/* ─── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-wrapper { margin-left: 0; }
  .main { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
}
