/* ============================================================
   Delhi College — Business Administration Results Portal
   business.css  |  Theme: Corporate Ledger
   Palette: Navy · Gold · Ivory
   ============================================================ */

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

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

/* ── Design Tokens ── */
:root {
  --navy:         #0F1F3D;
  --navy-mid:     #1A3360;
  --navy-light:   #243E6E;
  --gold:         #C9A84C;
  --gold-dark:    #A8892E;
  --gold-light:   #E8D49A;
  --gold-pale:    #FAF5E4;
  --ivory:        #F9F7F2;
  --white:        #FFFFFF;
  --slate:        #4A5568;
  --slate-light:  #6B7280;
  --border:       #D6CEB8;
  --row-alt:      #F4F1E8;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --green:        #15803D;
  --blue:         #1D4ED8;
  --cyan:         #0E7490;
  --amber:        #B45309;
  --orange:       #C2410C;
  --gray:         #6B7280;

  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   18px;
  --shadow: 0 8px 40px rgba(15,31,61,0.20), 0 2px 10px rgba(15,31,61,0.12);
}

/* ── Base ── */
html, body {
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--navy);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════
   BACKGROUND SLIDESHOW
══════════════════════════════════════ */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
}

.bg-slide.active { opacity: 1; }

.bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 38, 0.68);
  z-index: -1;
}

/* ══════════════════════════════════════
   LOGO BOX
══════════════════════════════════════ */
.logo-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.logo-box img {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--gold);
  box-shadow: 0 0 0 4px var(--gold-pale);
  flex-shrink: 0;
}

.logo-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.logo-text h2 {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate);
  margin-top: 2px;
}

.portal-tag {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

/* Compact variant used in results header */
.logo-box.compact {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.logo-box.compact img {
  width: 52px;
  height: 52px;
}

.logo-box.compact .logo-text h1 { font-size: 1.1rem; }
.logo-box.compact .logo-text h2 { font-size: 0.82rem; }

/* ══════════════════════════════════════
   LOGIN CARD
══════════════════════════════════════ */
.login-card {
  position: relative;
  z-index: 10;
  width: min(440px, 94vw);
  margin: 52px auto 60px;
  padding: 40px 38px 32px;
  background: var(--white);
  border-radius: var(--r-lg);
  border-top: 5px solid var(--gold);
  box-shadow: var(--shadow);
}

/* ── Form Fields ── */
.field-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.94rem;
  color: var(--navy);
  background: var(--ivory);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.18);
}

input::placeholder {
  color: #B5AC97;
  font-size: 0.88rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.14s, box-shadow 0.18s;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  font-size: 0.92rem;
  margin-top: 8px;
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 3px 12px rgba(201,168,76,0.32);
}

.btn-primary:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(201,168,76,0.42);
}

.btn-ghost {
  background: var(--ivory);
  color: var(--navy);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--navy);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--white);
}

.btn:active { transform: translateY(0); }

.btn-icon { font-size: 1rem; font-weight: 400; }

/* ── Error ── */
.error-msg {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  color: var(--danger);
  font-size: 0.87rem;
  font-weight: 500;
  line-height: 1.45;
}

/* ── Loading ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  color: var(--slate);
  font-size: 0.88rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gold-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card Footer ── */
.card-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.back-link {
  font-size: 0.83rem;
  color: var(--slate-light);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover { color: var(--gold-dark); }

/* ══════════════════════════════════════
   RESULTS CARD
══════════════════════════════════════ */
.results-card {
  position: relative;
  z-index: 10;
  width: min(820px, 96vw);
  margin: 40px auto 64px;
  background: var(--white);
  border-radius: var(--r-lg);
  border-top: 5px solid var(--gold);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 36px 24px;
  border-bottom: 1px solid var(--border);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Student Info Strip ── */
.student-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0;
  margin: 0 36px 28px;
  border-radius: var(--r-md);
  border: 1px solid var(--gold-light);
  overflow: hidden;
  background: var(--gold-pale);
}

.student-info div {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--slate);
  border-right: 1px solid var(--gold-light);
  border-bottom: 1px solid var(--gold-light);
  line-height: 1.5;
}

.student-info div:last-child {
  border-right: none;
}

.student-info strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 2px;
}

/* ── Status Badges ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
}

.status-active    { background: #D97706; }
.status-completed { background: var(--green); }
.status-inactive  { background: var(--danger); }
.status-unknown   { background: var(--gray); }

/* ── Courses Container ── */
.courses-container {
  padding: 0 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Course Block ── */
.course-block {
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15,31,61,0.06);
}

.course-header {
  padding: 14px 20px;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}

.course-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

/* ── Results Table ── */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.91rem;
}

.results-table thead tr {
  background: var(--navy-mid);
}

.results-table thead th {
  padding: 11px 18px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.results-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.14s;
}

.results-table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.results-table tbody tr:last-child {
  border-bottom: none;
}

.results-table tbody tr:hover {
  background: var(--gold-pale);
}

.results-table tbody td {
  padding: 12px 18px;
  color: var(--slate);
  vertical-align: middle;
}

.results-table tbody td:first-child {
  color: var(--navy);
  font-weight: 500;
}

/* ── Grade Colours ── */
td.grade-A { color: var(--green);  font-weight: 700; }
td.grade-B { color: var(--blue);   font-weight: 700; }
td.grade-C { color: var(--cyan);   font-weight: 700; }
td.grade-D { color: var(--amber);  font-weight: 700; }
td.grade-E { color: var(--orange); font-weight: 700; }
td.grade-F { color: var(--danger); font-weight: 700; }

/* ── Metrics Bar ── */
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 18px 22px;
  background: var(--navy);
  border-top: 3px solid var(--gold);
}

.metric { display: flex; flex-direction: column; gap: 2px; }

.metric .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.metric .value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

/* ── No Results Summary ── */
.summary {
  padding: 40px 24px;
  text-align: center;
  color: var(--slate);
}

.summary h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 8px;
}

/* ══════════════════════════════════════
   PRINT
══════════════════════════════════════ */
@media print {
  .bg-slideshow,
  .bg-overlay,
  .action-buttons,
  .card-footer { display: none !important; }

  body { background: var(--white) !important; }

  .results-card {
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-top: 3px solid var(--gold) !important;
  }

  .results-header { padding: 16px 20px; }
  .student-info   { margin: 0 20px 20px; }
  .courses-container { padding: 0 20px 20px; }

  .course-header,
  .results-table thead tr,
  .metrics {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 640px) {
  .login-card {
    padding: 30px 20px 26px;
    margin: 28px auto 40px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px 18px;
  }

  .student-info {
    margin: 0 18px 22px;
    grid-template-columns: 1fr 1fr;
  }

  .courses-container { padding: 0 18px 28px; }

  .results-table { font-size: 0.82rem; }
  .results-table thead th,
  .results-table tbody td { padding: 9px 10px; }

  .metric .value { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner        { animation: none; border-top-color: var(--gold); }
  .bg-slide       { transition: none; }
  .btn            { transition: none; }
}
