/* ============================================================
   VTU Result Portal — style.css
   Black Theme · Monochrome · Sharp
   ============================================================ */
 
/* ---- CSS Variables ---------------------------------------- */
:root {
  --bg:             #000000;
  --bg-secondary:   #0a0a0a;
  --surface:        #111111;
  --surface-hover:  #1a1a1a;
  --surface-active: #222222;
  --border:         rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.18);
  --border-accent:  rgba(255,255,255,0.35);
  --text:           #ffffff;
  --text-muted:     #a0a0a0;
  --text-dim:       #606060;
  --accent:         #ffffff;
  --accent-glow:    rgba(255,255,255,0.08);
  --radius:         16px;
  --radius-sm:      10px;
  --shadow:         0 8px 32px rgba(0,0,0,0.8);
  --shadow-strong:  0 16px 48px rgba(0,0,0,0.95);
  --font-display:   'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;
}
 
/* Light theme overrides — still black-dominant */
[data-theme="light"] {
  --bg:             #000000;
  --bg-secondary:   #080808;
  --surface:        #111111;
  --surface-hover:  #1c1c1c;
  --surface-active: #242424;
  --border:         rgba(255,255,255,0.10);
  --border-strong:  rgba(255,255,255,0.22);
  --border-accent:  rgba(255,255,255,0.40);
  --text:           #ffffff;
  --text-muted:     #999999;
  --text-dim:       #555555;
  --shadow:         0 8px 32px rgba(0,0,0,0.9);
}
 
/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.4s, color 0.4s;
}
button { cursor: pointer; border: none; outline: none; background: none; font-family: inherit; }
input  { font-family: inherit; outline: none; border: none; background: none; color: var(--text); }
img    { max-width: 100%; display: block; }
 
/* ---- Background: pure black, subtle noise grid ------------ */
.bg-orbs { display: none; } /* removed colour orbs */
 
.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}
 
/* ---- Glass card — dark glass on black --------------------- */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
 
/* ---- Layout wrappers --------------------------------------- */
main {
  position: relative; z-index: 1;
  max-width: 900px; margin: 0 auto;
  padding: 0 16px 80px;
}
 
/* ---- Header ----------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #000000;
  border-bottom: 1px solid var(--border-strong);
  transition: background 0.4s;
}
.header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon svg { width: 40px; height: 40px; }
.logo-title {
  display: block; font-family: var(--font-display);
  font-weight: 800; font-size: 1.1rem; letter-spacing: -0.3px;
  color: #ffffff;
}
.logo-sub { display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.header-nav { display: flex; gap: 8px; }
.btn-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--border-accent); color: #ffffff; transform: scale(1.05); }
.icon-sun  { display: none; font-size: 15px; }
.icon-moon { display: block; font-size: 15px; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }
 
/* ---- Hero -------------------------------------------------- */
.search-section { padding: 48px 0 24px; }
.search-hero { text-align: center; margin-bottom: 36px; }
.hero-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.5rem); line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 14px;
  color: #ffffff;
}
.gradient-text { color: #ffffff; }
.hero-sub { color: var(--text-muted); font-size: 1rem; max-width: 480px; margin: 0 auto; }
 
/* ---- Search card ------------------------------------------- */
.search-card { padding: 28px; }
.input-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.glass-card.search-card {
    /* Styles here apply only if BOTH classes are present */
    background: black;
    border :1px solid var(--border-strong);
    backdrop-filter: blur(10px);
}


.input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.usn-input-wrap {
  flex: 1; min-width: 200px;
  position: relative; display: flex; align-items: center;
  background: #000000;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.usn-input-wrap:focus-within {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}
.input-icon { color: var(--text-dim); flex-shrink: 0; }
#usnInput {
  flex: 1; padding: 14px 10px;
  font-size: 1rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: #ffffff;
}
#usnInput::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.usn-badge { font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; display: none; }
.usn-badge.valid   { display: block; background: rgba(255,255,255,0.1); color: #ffffff; border: 1px solid rgba(255,255,255,0.25); }
.usn-badge.invalid { display: block; background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid var(--border-strong); }
 
.btn-search {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 700;
  background: #ffffff;
  color: #000000; letter-spacing: 0.02em;
  transition: all 0.25s; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(255,255,255,0.12);
}
.btn-search:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,255,255,0.18); background: #e8e8e8; }
.btn-search:active:not(:disabled) { transform: translateY(0); }
.btn-search:disabled { opacity: 0.3; cursor: not-allowed; }
 
.input-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 8px; }
 
/* ---- Captcha panel ---------------------------------------- */
.captcha-panel { margin-top: 24px; padding-top: 20px; }
.captcha-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; color: var(--text-dim); font-size: 0.78rem;
}
.captcha-divider::before, .captcha-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.captcha-img-wrap {
  position: relative; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border-strong);
  min-width: 140px; min-height: 52px;
  display: grid; place-items: center;
  background: var(--surface);
}
#captchaImg { height: 52px; object-fit: contain; display: block; }
.captcha-loader {
  position: absolute; inset: 0; background: rgba(0,0,0,0.75);
  display: grid; place-items: center;
}
.spin {
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
 
.btn-refresh {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-muted);
  transition: all 0.2s; flex-shrink: 0;
}
.btn-refresh:hover { color: #ffffff; border-color: #ffffff; transform: rotate(90deg); }
 
.captcha-input-wrap {
  flex: 1; min-width: 140px;
  background: #000000;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
#captchaInput {
  width: 100%; padding: 11px 14px;
  font-size: 1.1rem; font-weight: 700; letter-spacing: 0.2em;
  color: #ffffff;
}
#captchaInput::placeholder { letter-spacing: 0; font-weight: 400; color: var(--text-dim); }
.captcha-input-wrap:focus-within {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.08);
}
 
.btn-submit-captcha {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 700;
  background: #ffffff;
  color: #000000; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(255,255,255,0.10);
  transition: all 0.2s;
}
.btn-submit-captcha:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,255,255,0.15); background: #e8e8e8; }
 
/* ---- History panel ---------------------------------------- */
.history-panel { padding: 20px; margin-top: 16px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.history-header h3 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: #ffffff; }
.btn-clear-history { font-size: 0.75rem; color: var(--text-muted); opacity: 0.8; transition: opacity 0.2s; }
.btn-clear-history:hover { opacity: 1; color: #ffffff; }
.history-list { display: flex; flex-wrap: wrap; gap: 8px; }
.history-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 8px;
  background: var(--surface-hover); border: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.03em;
  cursor: pointer; transition: all 0.15s;
}
.history-item:hover { border-color: var(--border-accent); color: #ffffff; }
.history-item .hist-time { font-size: 0.68rem; font-weight: 400; color: var(--text-dim); }
 
/* ---- Loader ----------------------------------------------- */
.loader-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.85);
  display: grid; place-items: center;
}
.loader-card {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 20px; padding: 40px 56px;
  text-align: center; box-shadow: var(--shadow-strong);
}
.loader-rings { position: relative; width: 72px; height: 72px; margin: 0 auto 24px; }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid transparent; animation: ringPulse 1.4s ease-in-out infinite;
}
.ring-1 { border-top-color: #ffffff;   animation-delay: 0s; }
.ring-2 { inset: 10px; border-top-color: #aaaaaa; animation-delay: 0.3s; }
.ring-3 { inset: 20px; border-top-color: #555555; animation-delay: 0.6s; }
.loader-dot {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: #ffffff;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes ringPulse { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.3); } }
.loader-msg { font-weight: 600; font-size: 1rem; margin-bottom: 4px; color: #ffffff; }
.loader-sub { font-size: 0.78rem; color: var(--text-muted); }
 
/* ---- Error banner ----------------------------------------- */
.error-banner {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 150; width: min(520px, 94vw);
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
.error-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  background: #111111; border: 1px solid rgba(255,255,255,0.2);
}
.error-icon { font-size: 1.2rem; flex-shrink: 0; }
#errorMsg { flex: 1; font-size: 0.88rem; color: #cccccc; }
.btn-close-error { font-size: 0.8rem; color: var(--text-dim); transition: color 0.2s; }
.btn-close-error:hover { color: #ffffff; }
 
/* ---- Result section --------------------------------------- */
.result-section { padding-top: 24px; }
.result-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.btn-back {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); transition: all 0.2s;
}
.btn-back:hover { color: #ffffff; border-color: var(--border-accent); }
.toolbar-actions { display: flex; align-items: center; gap: 10px; }
.source-badge {
  font-size: 0.68rem; font-weight: 700; padding: 4px 10px;
  border-radius: 6px; text-transform: uppercase; letter-spacing: 0.05em;
}
.source-badge.cache  { background: rgba(255,255,255,0.08); color: #aaaaaa; border: 1px solid rgba(255,255,255,0.15); }
.source-badge.scrape { background: rgba(255,255,255,0.12); color: #ffffff; border: 1px solid rgba(255,255,255,0.22); }
.btn-action {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 0.83rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); transition: all 0.2s;
}
.btn-action:hover { color: #ffffff; border-color: var(--border-accent); }
 
/* ---- Profile card ----------------------------------------- */
.profile-card {
  display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; padding: 24px 28px; margin-bottom: 16px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 18px; flex-shrink: 0;
  background: var(--surface-active);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.6rem; color: #ffffff;
}
.profile-info { flex: 1; min-width: 180px; }
.profile-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.3rem; letter-spacing: -0.5px; margin-bottom: 4px; color: #ffffff;
}
.profile-usn { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; letter-spacing: 0.05em; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.72rem; font-weight: 600; padding: 3px 10px;
  border-radius: 6px; background: var(--surface-hover);
  border: 1px solid var(--border); color: var(--text-muted);
}
.profile-stats {
  display: flex; gap: 0; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.stat-box {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 22px; gap: 4px;
  border-right: 1px solid var(--border);
}
.stat-box:last-child { border-right: none; }
.stat-val {
  font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: #ffffff;
}
.stat-lbl { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
 
/* ---- Calc bar --------------------------------------------- */
.calc-bar {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0; padding: 0; margin-bottom: 16px; overflow: hidden;
}
.calc-section {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; min-width: 150px;
}
.calc-divider { width: 1px; height: 40px; background: var(--border); flex-shrink: 0; }
.calc-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.calc-select {
  flex: 1; background: #000000; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 10px; color: #ffffff;
  font-size: 0.82rem; font-family: var(--font-body);
}
.calc-select option { background: #111111; color: #ffffff; }
.calc-result {
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: #ffffff;
}
.cgpa-big { font-size: 1.4rem; }
 
/* ---- Chart card ------------------------------------------- */
.chart-card { padding: 24px; margin-bottom: 20px; }
.chart-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.chart-header h3 { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: #ffffff; }
.chart-legend { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ffffff; }
.chart-wrap { position: relative; height: 220px; }
 
/* ---- Semester cards --------------------------------------- */
.semesters-grid { display: flex; flex-direction: column; gap: 12px; }
.sem-card { border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.2s; }
.sem-card:hover { box-shadow: 0 0 0 1px var(--border-strong); }
 
.sem-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s; user-select: none;
}
.sem-card.open .sem-header {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}
.sem-header:hover { background: var(--surface-hover); }
.sem-header-left { display: flex; align-items: center; gap: 14px; }
.sem-number {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface-active);
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: #ffffff;
}
.sem-title { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: #ffffff; }
.sem-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.sem-header-right { display: flex; align-items: center; gap: 12px; }
.sem-sgpa-pill {
  font-family: var(--font-display); font-weight: 800; font-size: 0.85rem;
  padding: 5px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff;
}
.sem-toggle-icon { color: var(--text-dim); transition: transform 0.3s; }
.sem-card.open .sem-toggle-icon { transform: rotate(180deg); }
 
.sem-body {
  display: none; overflow-x: auto;
  background: #000000;
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.sem-card.open .sem-body { display: block; }
 
table.result-table {
  width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 500px;
}
table.result-table thead th {
  padding: 12px 14px; text-align: left;
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.result-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
table.result-table tbody tr:last-child { border-bottom: none; }
table.result-table tbody tr:hover { background: var(--surface); }
table.result-table tbody td { padding: 12px 14px; vertical-align: middle; color: #ffffff; }
.td-code { font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.td-name { font-weight: 500; }
.td-marks { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.td-total { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.td-result { text-align: center; }
 
/* ---- Result badges ---------------------------------------- */
.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 800;
  padding: 3px 10px; border-radius: 6px; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-P  { background: rgba(255,255,255,0.10); color: #ffffff; border: 1px solid rgba(255,255,255,0.22); }
.badge-F  { background: rgba(255,255,255,0.04); color: #888888; border: 1px solid rgba(255,255,255,0.10); }
.badge-AB { background: rgba(255,255,255,0.03); color: #666666; border: 1px solid rgba(255,255,255,0.08); }
.badge-RV { background: rgba(255,255,255,0.07); color: #aaaaaa; border: 1px solid rgba(255,255,255,0.15); }
.badge-WH { background: rgba(255,255,255,0.06); color: #999999; border: 1px solid rgba(255,255,255,0.12); }
.badge-BL { background: rgba(255,255,255,0.05); color: #888888; border: 1px solid rgba(255,255,255,0.10); }
.badge-NA { background: transparent;           color: var(--text-dim); border: 1px solid var(--border); }
 
/* ---- Footer ----------------------------------------------- */
.site-footer {
  position: relative; z-index: 1;
  text-align: center; padding: 24px 20px;
  font-size: 0.72rem; color: var(--text-dim);
  border-top: 1px solid var(--border);
}
 
/* ---- Animations ------------------------------------------- */
.fade-in  { animation: fadeIn 0.4s ease both; }
.slide-up { animation: slideUp 0.4s ease both; }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
 
/* ---- Responsive ------------------------------------------- */
@media (max-width: 600px) {
  .profile-card { flex-direction: column; text-align: center; }
  .profile-stats { width: 100%; }
  .stat-box { padding: 12px 16px; }
  .calc-bar { flex-direction: column; }
  .calc-section { width: 100%; }
  .calc-divider { width: 100%; height: 1px; }
  .captcha-row { flex-direction: column; align-items: stretch; }
  .btn-submit-captcha, .captcha-input-wrap { width: 100%; justify-content: center; }
  .hero-title { font-size: 2rem; }
  .input-row { flex-direction: column; }
  .btn-search { justify-content: center; }
}
 