/* ============================================================
   NPTEL – shared styles (built on Bootstrap 5.3 + Bootstrap Icons)
   ============================================================ */

:root {
  --nptel: #800020;
  --nptel-dark: #5e0017;
  --nptel-hover: #99002a;
  --nptel-tint: #f8e1e7;
  --score-high: #198754;
  --score-mid: #e8a900;
  --score-low: #dc3545;
  --muted: #6c757d;
  --line: #e4e6e9;
}

body {
  background: #fff;
  color: #212529;
}

/* ---------- Navbar ---------- */
.nptel-navbar {
  background: var(--nptel);
  --bs-navbar-color: rgba(255, 255, 255, 0.55);
  --bs-navbar-hover-color: rgba(255, 255, 255, 0.85);
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
  --bs-navbar-active-color: #fff;
}
.nptel-navbar .navbar-brand i {
  font-size: 1.25rem;
  line-height: 1;
  vertical-align: -0.12em;
}

/* ---------- Migration banner ---------- */
.migration-banner {
  background: var(--nptel-tint);
  color: var(--nptel);
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5625rem 1rem;
  text-align: center;
}
.migration-banner a {
  color: var(--nptel);
  font-weight: 600;
  text-decoration: underline;
}
.migration-banner a:hover {
  color: var(--nptel-dark);
}

/* ---------- Buttons ---------- */
.btn-nptel {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--nptel);
  --bs-btn-border-color: var(--nptel);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--nptel-dark);
  --bs-btn-hover-border-color: var(--nptel-dark);
  --bs-btn-focus-shadow-rgb: 128, 0, 32;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--nptel-dark);
  --bs-btn-active-border-color: var(--nptel-dark);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--nptel);
  --bs-btn-disabled-border-color: var(--nptel);
}

/* ---------- Badges ---------- */
.badge-nptel {
  background: var(--nptel);
  color: #fff;
}
.status-badge,
.noc-badge,
.badge-nptel {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4em 0.65em;
  border-radius: 0.3rem;
  letter-spacing: 0.01em;
}
.noc-badge {
  display: inline-block;
  background: var(--nptel);
  color: #fff;
  line-height: 1.1;
  white-space: nowrap;
}

/* ---------- Page title / filters ---------- */
.page-title {
  font-size: 2rem;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.page-title i {
  font-size: 2rem;
  line-height: 1;
}

.view-toggle {
  margin-top: 4px;
}

.filter-bar {
  padding-left: 1rem;
}
.filter-bar label {
  font-size: 0.875rem;
  color: #495057;
  margin-bottom: 0.25rem;
}

/* ---------- Course sections ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0;
}
.section-title .count {
  font-size: 1rem;
  font-weight: 600;
  min-width: 30px;
  padding: 0.45rem 0.55rem;
  line-height: 1;
  border-radius: 0.3rem;
}
.section-current { color: #198754; }
.section-past { color: #6c757d; }

.course-table-wrap {
  border-radius: 0.5rem 0.5rem 0 0;
  overflow: hidden;
}
.course-table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  font-size: 1rem;
}
.course-table thead th {
  background: #f8f9fa;
  font-weight: 600;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.course-table tbody td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.course-table tbody tr:last-child td {
  border-bottom: 1px solid var(--line);
}
.course-table tbody tr:hover > * {
  background: #fcfafa;
}
.course-table .badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.course-table .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.course-table .btn {
  white-space: nowrap;
}
.score {
  font-weight: 600;
  white-space: nowrap;
}
.score.high { color: var(--score-high); }
.score.mid { color: var(--score-mid); }
.score.low { color: var(--score-low); }
.score.none { color: var(--muted); font-weight: 400; }

.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 1.25rem 0.5rem !important;
}

.course-card {
  border-color: var(--line);
  border-radius: 0.6rem;
}
.course-card .card-footer {
  border-top-color: var(--line);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- Course detail ---------- */
.breadcrumb {
  --bs-breadcrumb-divider-color: #6c757d;
  --bs-breadcrumb-item-active-color: #6c757d;
  margin-bottom: 0.8rem;
}
.course-hero {
  background: var(--nptel);
  color: #fff;
  border-radius: 0.6rem;
  padding: 1.4rem 1.5rem 1.35rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}
.course-hero h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  line-height: 1.2;
}
.course-hero p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.82);
}

.panel {
  border-radius: 0.5rem;
  overflow: hidden;
}
.panel-bar {
  background: var(--nptel);
  color: #fff;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.panel-bar h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
  min-height: 24px;
}
.panel-bar .btn-outline-success {
  --bs-btn-color: #2f9d68;
  --bs-btn-border-color: #2f9d68;
  --bs-btn-hover-bg: #198754;
  --bs-btn-hover-border-color: #198754;
  --bs-btn-hover-color: #fff;
  font-size: 0.875rem;
}

.result-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  padding: 22px 12px 24px;
}
.result-stats {
  display: flex;
  flex-wrap: wrap;
}
.result-stat {
  width: 227px;
  text-align: center;
  line-height: 1.25;
}
.result-stat .num {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--nptel);
}
.result-stat .num small {
  font-size: 0.9rem;
  color: #495057;
  font-weight: 400;
}
.result-stat .num.mid { color: var(--score-mid); }
.result-stat .num.high { color: var(--score-high); }
.result-stat .lbl {
  color: #6c757d;
  font-size: 0.95rem;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 8px;
}
.celebrate-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}
.celebrate-wrap .btn {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}
.celebrate-wrap small {
  font-size: 0.72rem;
  line-height: 1.3;
  color: #6c757d;
}
.result-actions .btn { font-size: 0.875rem; font-weight: 600; }
.result-note {
  color: #6c757d;
  font-size: 1rem;
  align-self: flex-start;
  padding-top: 0.2rem;
}

.detail-card {
  background: #fff;
}
.detail-card .panel-bar {
  padding: 0.5rem 1rem;
}
.detail-body {
  padding: 1rem 1rem 1.25rem;
}
.kv { margin-bottom: 0.5rem; }
.kv .k {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.5;
  color: #212529;
}
.kv .v {
  display: block;
  line-height: 1.5;
}
.kv .badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4em 0.7em;
  border-radius: 0.3rem;
}

.summary-body {
  display: flex;
  padding: 1.15rem 1rem;
}
.summary-stat {
  flex: 1;
  text-align: center;
  line-height: 1.3;
}
.summary-stat .big {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--nptel);
  line-height: 1.15;
}
.summary-stat .lbl {
  color: #6c757d;
}

.assign-table {
  margin: 0;
  font-size: 1rem;
  --bs-table-bg: transparent;
  table-layout: fixed;
  min-width: 720px;
}
.assign-table th {
  background: #f8f9fa;
  font-weight: 600;
  padding: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.assign-table td {
  padding: 0.525rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.assign-table .c { text-align: center; }
.assign-table .badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4em 0.65em;
  border-radius: 0.3rem;
}

/* ---------- Celebrate modal ---------- */
.celebrate-dialog { max-width: 500px; }
.celebrate-content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}
.celebrate-hero {
  position: relative;
  height: 92px;
  background: linear-gradient(100deg, #7f0020 0%, #c2185b 55%, #f0621f 100%);
}
.celebrate-hero .btn-close {
  position: absolute;
  top: 14px;
  right: 14px;
  filter: invert(1) grayscale(100%) brightness(200%);
  opacity: 0.95;
  box-shadow: none;
}
.celebrate-emblem {
  position: absolute;
  left: 50%;
  bottom: -41px;
  transform: translateX(-50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.celebrate-body {
  padding: 58px 40px 28px;
  text-align: center;
}
.celebrate-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.55rem;
}
.celebrate-body .sub {
  color: #6c757d;
  margin: 0;
  font-size: 0.95rem;
}
.celebrate-points {
  list-style: none;
  margin: 1.1rem 30px 3rem;
  padding: 0;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #343a40;
}
.celebrate-points li { margin-bottom: 0.3rem; }
.celebrate-points i {
  color: #6c757d;
  margin-right: 0.35rem;
  font-size: 0.9rem;
  vertical-align: -0.08em;
}
.celebrate-points li:first-child i { color: var(--nptel); }
.celebrate-actions {
  display: flex;
  justify-content: center;
  gap: 7px;
}
.celebrate-actions .btn {
  border-radius: 8px;
  padding: 0.55rem 1.5rem;
  font-weight: 500;
  border: 0;
}
.celebrate-actions .btn-ghost { padding-left: 1.6rem; padding-right: 1.6rem; }
.celebrate-actions .btn-celebrate { padding-left: 1.8rem; padding-right: 1.8rem; }
.btn-ghost {
  background: #f1f1f3;
  color: #212529;
}
.btn-ghost:hover { background: #e6e6ea; color: #212529; }
.btn-celebrate {
  background: var(--nptel);
  color: #fff;
  font-weight: 600 !important;
}
.btn-celebrate:hover { background: var(--nptel-dark); color: #fff; }

/* ---------- Dashboard ---------- */
.dash-main { padding-bottom: 4.55rem; }
.page-title-lg { gap: 0.75rem; }
.page-title-lg,
.page-title-lg i { font-size: 2.5rem; }

.stat-row { margin-bottom: 40px; }
.stat-card {
  color: #fff;
  border-radius: 0.5rem;
}
.stat-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}
.stat-label {
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0.25rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}
.stat-icon {
  font-size: 3.5rem;
  line-height: 1;
}
.stat-courses { background: var(--nptel); }
.stat-certs { background: #198754; }
.stat-active { background: #0dcaf0; }
.stat-pending { background: #ffc107; }

.dash-card {
  border-radius: 0.5rem;
  overflow: hidden;
}
.dash-head {
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1rem;
}
.dash-head-nptel { background: var(--nptel); }
.dash-head-success { background: #198754; }
.dash-head-warning { background: #ffc107; }
.dash-card .btn { font-weight: 600; }

.activity-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.52rem;
  border-radius: 0.375rem;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 48px 0 48px;
}
.site-footer h6 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: #212529;
}
.site-footer p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6c757d;
  margin-bottom: 0.25rem;
}
.site-footer .follow {
  display: flex;
  margin-top: 1.4rem;
  gap: 20px;
  font-size: 1.5rem;
  line-height: 1;
}
.site-footer .follow a { color: #4b5563; }
.site-footer .follow a:hover { color: var(--nptel); }
.site-footer .partners {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .partners img {
  height: 40px;
  width: auto;
  display: block;
}
.site-footer .nptel-logo {
  display: block;
  max-width: 100%;
  height: auto;
}
.site-footer hr {
  margin: 1.8rem 0 1.2rem;
  color: #ced4da;
  opacity: 1;
}
.site-footer .copy {
  text-align: center;
  font-size: 0.875rem;
  color: #6c757d;
  margin: 0;
}

/* ---------- Floating report button ---------- */
.report-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1030;
  background: var(--nptel);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.report-fab:hover { background: var(--nptel-dark); color: #fff; }

@media (max-width: 575.98px) {
  .page-title, .page-title i { font-size: 1.6rem; }
  .course-hero h1 { font-size: 1.4rem; }
  .result-stat { width: 33.33%; min-width: 100px; }
  .celebrate-body { padding-left: 20px; padding-right: 20px; }
  .celebrate-points { margin-left: 0; margin-right: 0; }
}
