@charset "utf-8";

/* ==========================================================================
   NPTEL Design Tokens & Bootstrap Overrides
   ========================================================================== */
:root {
  --nptel-primary: #800020;
  --nptel-primary-light: #5a0018;
  --nptel-primary-lighter: #9a0026;
  --nptel-accent: #FFD700;
  --nptel-secondary: #6c757d;
  --nptel-success: #198754;
  --nptel-info: #0dcaf0;
  --nptel-warning: #ffc107;
  --nptel-danger: #dc3545;
  --nptel-text-dark: #1c1c28;
  --nptel-text-muted: #555770;
  --nptel-bg-light: #FFF8E7;
  --bs-primary: #800020;
  --bs-primary-rgb: 128, 0, 32;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  color: #212529;
}

main {
  flex: 1 1 0%;
}

/* ==========================================================================
   Navbar & Branding
   ========================================================================== */
.navbar {
  z-index: 1030;
}

.bg-primary {
  background-color: #800020 !important;
}

.text-primary {
  color: #800020 !important;
}

.btn-primary {
  background-color: #800020;
  border-color: #800020;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #5a0018;
  border-color: #5a0018;
}

.border-primary {
  border-color: #800020 !important;
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.85rem;
  transition: color 0.2s, background-color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.navbar-brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Cards & Content Elements
   ========================================================================== */
.card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  background-color: #ffffff;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
  background-color: #800020;
  color: #ffffff;
  font-weight: 600;
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
  border-bottom: none;
}

.card.bg-primary {
  background-color: #800020 !important;
  color: #ffffff;
}

.breadcrumb {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.breadcrumb-item a {
  color: #800020;
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
}

/* ==========================================================================
   Results Line & Actions
   ========================================================================== */
.result-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 1rem;
  margin: 0;
  padding: 0.5rem 0 1rem;
}

@media (min-width: 768px) {
  .result-line {
    justify-content: space-between;
    padding: 0.5rem 1rem 1rem;
  }
  .result-line .result-scores {
    display: flex;
    flex: 1 1 auto;
    justify-content: space-around;
    gap: 1rem;
  }
  .result-line .result-scores > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .result-line .result-scores .h3 {
    font-size: 1.75rem;
    font-weight: 700;
  }
  .result-line .result-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }
  .result-line .result-actions .btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
  }
  .result-line .act {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* ==========================================================================
   Celebration Button & Animations
   ========================================================================== */
.celebrate-wrap {
  position: relative;
  display: inline-block;
}

.btn-celebrate {
  color: #ffffff !important;
  border: 0;
  border-radius: var(--bs-border-radius-lg, 0.5rem);
  padding: 0.55rem 1.15rem;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(110deg, #800020, #a0103a, #c2185b, #b3124a, #800020) 0% 0% / 300% 100%;
  animation: flow 4s linear infinite, glow 2.2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.btn-celebrate:hover,
.btn-celebrate:focus-visible {
  color: #ffffff;
  transform: translateY(-2px) scale(1.03);
}

.btn-celebrate:active {
  transform: scale(0.97);
}

.btn-celebrate > span {
  position: relative;
  z-index: 1;
}

.btn-celebrate .emoji {
  display: inline-block;
  margin-right: 0.4rem;
  animation: wiggle 1s ease-in-out infinite;
  transform-origin: 50% 80%;
}

.btn-celebrate::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  opacity: 0;
  animation: twinkle 2.4s ease-in-out infinite;
}

.sparkle.s1 { top: -12px; left: -8px; animation-delay: 0s; }
.sparkle.s2 { top: -14px; right: -6px; animation-delay: 0.8s; font-size: 12px; }
.sparkle.s3 { bottom: -12px; right: 12px; animation-delay: 1.6s; font-size: 11px; }
.sparkle.s4 { bottom: -10px; left: 14px; animation-delay: 1.2s; font-size: 10px; }

@keyframes flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 180, 0, 0), 0 4px 12px rgba(194, 24, 91, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(244, 180, 0, 0.25), 0 6px 22px rgba(194, 24, 91, 0.55); }
}

@keyframes shimmer {
  0% { left: -60%; }
  45%, 100% { left: 130%; }
}

@keyframes wiggle {
  0%, 55%, 100% { transform: rotate(0deg) scale(1); }
  62% { transform: rotate(-16deg) scale(1.2); }
  70% { transform: rotate(14deg) scale(1.2); }
  78% { transform: rotate(-8deg); }
  86% { transform: rotate(5deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(25deg); }
}

@keyframes pop {
  0% { transform: scale(0.3) rotate(-20deg); }
  60% { transform: scale(1.25) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ==========================================================================
   Report Button & Badges
   ========================================================================== */
.btn-report {
  --bs-btn-color: #3d2a00;
  --bs-btn-bg: #ffc107;
  --bs-btn-border-color: #ffc107;
  --bs-btn-hover-color: #2b1d00;
  --bs-btn-hover-bg: #ffb300;
  --bs-btn-hover-border-color: #ffb300;
  --bs-btn-active-color: #2b1d00;
  --bs-btn-active-bg: #ffb300;
  --bs-btn-active-border-color: #ffb300;
  font-weight: 600;
  color: #3d2a00;
  background-color: #ffc107;
  border-color: #ffc107;
}

.cert-tier-gold {
  background: linear-gradient(135deg, #ffe066 0%, #d4a72c 50%, #c08a18 100%);
  color: #3b2c00;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cert-tier-silver {
  background: linear-gradient(135deg, #f1f3f5 0%, #adb5bd 50%, #6c757d 100%);
  color: #1f2429;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.cert-tier-elite {
  background: linear-gradient(135deg, #cce5ff 0%, #66b0ff 50%, #0069d9 100%);
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   Modals & Confetti Canvas
   ========================================================================== */
.celebrate-modal .modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
}

.celebrate-modal .modal-header {
  border: 0;
  padding: 0;
  height: 92px;
  position: relative;
  background: linear-gradient(110deg, #800020, #c2185b, #ff6f00, #f4b400, #c2185b, #800020) 0% 0% / 300% 100%;
  animation: flow 6s linear infinite;
}

.celebrate-modal .modal-header .btn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 1;
  filter: invert(1) drop-shadow(0 0 2px rgba(0, 0, 0, 0.7));
}

.celebrate-modal .big-emoji {
  font-size: 56px;
  line-height: 1;
  margin-top: -40px;
  display: inline-block;
  background: #ffffff;
  border-radius: 50%;
  width: 84px;
  height: 84px;
  padding-top: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  animation: pop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.celebrate-modal .points li {
  margin-bottom: 0.45rem;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2050;
  width: 100vw;
  height: 100vh;
}

/* ==========================================================================
   Floating Feedback Widget
   ========================================================================== */
.feedback-widget__fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1040;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Footer & Partner Logos
   ========================================================================== */
.nptel-footer {
  border-top: 1px solid #e5e7eb;
  background-color: #fafafc !important;
}

.nptel-footer h6 {
  color: #1c1c28;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.social-links a {
  color: #555770;
  font-size: 1.4rem;
  transition: color 0.2s;
  text-decoration: none;
}

.social-links a:hover {
  color: #800020;
}

.partner-logos img {
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  max-height: 40px;
  width: auto;
}

.partner-logos img:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* ==========================================================================
   Live Course Switcher / Preset Bar
   ========================================================================== */
.preview-switch-bar {
  background: #212529;
  color: #ffffff;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  border-bottom: 2px solid #800020;
}

.preview-switch-bar select,
.preview-switch-bar button {
  font-size: 0.85rem;
}
