/* ============================================================
   37th Foundation Day Examination Portal — Custom Styles
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --dark-900: #f8fafc;
  --dark-800: #f1f5f9;
  --dark-700: #e2e8f0;
}

/* ---------- Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark-900);
  color: #1e293b;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

main {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .2);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .45);
  border-radius: 3px;
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, .08);
}

.glass-card {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 1.25rem;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  border-color: rgba(0, 0, 0, .14);
}

/* ---------- Floating Blobs ---------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .35;
  pointer-events: none;
  animation: blobFloat 10s ease-in-out infinite alternate;
}

.blob-1 {
  width: 420px;
  height: 420px;
  background: var(--primary-500);
  top: -80px;
  left: -120px;
}

.blob-2 {
  width: 340px;
  height: 340px;
  background: var(--accent-500);
  top: 60%;
  right: -100px;
  animation-delay: -4s;
}

.blob-3 {
  width: 280px;
  height: 280px;
  background: #a78bfa;
  bottom: -60px;
  left: 30%;
  animation-delay: -7s;
}

@keyframes blobFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(25px, -20px) scale(1.08);
  }

  100% {
    transform: translate(-15px, 15px) scale(.95);
  }
}

/* ---------- Animations ---------- */
@keyframes shimmer-sweep {
  0% { transform: translateX(-150%) skewX(-25deg); }
  100% { transform: translateX(150%) skewX(-25deg); }
}

.animate-shimmer {
  position: relative;
  overflow: hidden;
}

.animate-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(79, 70, 229, 0.4), /* Deeper Indigo */
    rgba(59, 130, 246, 0.7), /* Intense Blue */
    rgba(79, 70, 229, 0.4),
    transparent
  );
  animation: shimmer-sweep 2s infinite; /* Faster for more impact */
  pointer-events: none;
}

/* Bold Blue Shimmer Border Effect */
@keyframes border-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.animate-shimmer-border {
  position: relative;
  z-index: 0;
  border: 1px solid transparent !important;
  background-clip: padding-box;
}

.animate-shimmer-border::before {
  content: "";
  position: absolute;
  inset: -3px; /* Adjusted for extra thickness */
  z-index: -1;
  border-radius: inherit;
  padding: 4px; /* Bold 4px Border */
  background: linear-gradient(
    90deg, 
    rgba(59, 130, 246, 0) 0%, 
    rgba(59, 130, 246, 0.8) 20%, 
    rgba(79, 70, 229, 1) 50%, /* Ultra-vibrant Indigo */
    rgba(59, 130, 246, 0.8) 80%, 
    rgba(59, 130, 246, 0) 100%
  );
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: border-shimmer 1.5s linear infinite; /* Dynamic speed */
  filter: drop-shadow(0 0 6px rgba(79, 70, 229, 0.6)); /* Radiant Glow */
  pointer-events: none;
}

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

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp .65s ease-out forwards;
}

.animate-fade-in {
  opacity: 0;
  animation: fadeIn .5s ease-out forwards;
}

/* Stagger delays */
.delay-1 {
  animation-delay: .1s;
}

.delay-2 {
  animation-delay: .2s;
}

.delay-3 {
  animation-delay: .3s;
}

.delay-4 {
  animation-delay: .4s;
}

.delay-5 {
  animation-delay: .5s;
}

.delay-6 {
  animation-delay: .6s;
}

/* ---------- Progress Bar ---------- */
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-400));
  transition: width 1.2s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Spinner ---------- */
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(0, 0, 0, .08);
  border-top-color: var(--primary-400);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ---------- Mobile Menu ---------- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100dvh;
  background: rgba(248, 250, 252, .97);
  backdrop-filter: blur(24px);
  border-right: 1px solid rgba(0, 0, 0, .08);
  z-index: 95;
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.mobile-drawer.active {
  transform: translateX(0);
}

/* ---------- Medals ---------- */
.medal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  flex-shrink: 0;
}

.medal-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 4px 16px rgba(251, 191, 36, .35);
}

.medal-silver {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  box-shadow: 0 4px 16px rgba(148, 163, 184, .3);
}

.medal-bronze {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  box-shadow: 0 4px 16px rgba(251, 146, 60, .3);
}

.medal-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  background: rgba(0, 0, 0, .06);
  color: rgba(0, 0, 0, .6);
  flex-shrink: 0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .875rem 1.5rem;
  border-radius: .875rem;
  z-index: 200;
  font-size: .9rem;
  transform: translateY(120px);
  opacity: 0;
  transition: all .35s cubic-bezier(.22, 1, .36, 1);
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-error {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
}

.toast-success {
  background: rgba(34, 197, 94, .15);
  border: 1px solid rgba(34, 197, 94, .3);
  color: #86efac;
}

/* ---------- Gradient Text ---------- */
.text-gradient {
  background: linear-gradient(135deg, #818cf8, #c084fc, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Button Glow ---------- */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  filter: blur(12px);
  transition: opacity .3s;
}

.btn-glow:hover::after {
  opacity: .6;
}

/* ---------- Shimmer Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, .8) 25%, rgba(0, 0, 0, .08) 50%, rgba(255, 255, 255, .8) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: .75rem;
}

/* ---------- Hero Shapes ---------- */
.hero-shape {
  position: absolute;
  opacity: .12;
  pointer-events: none;
  animation: blobFloat 7s ease-in-out infinite alternate;
}

/* ---------- Page Transition ---------- */
.page-enter {
  animation: fadeInUp .5s ease-out;
}

/* ---------- Responsive Fixes ---------- */
@media (max-width: 640px) {
  .blob {
    filter: blur(60px);
    opacity: .22;
  }
}

/* ---------- Popup Banner Modal Styles ---------- */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: auto;
}

.popup-overlay.active {
  opacity: 1;
}

.popup-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45%) scale(0.92);
  width: calc(100% - 32px);
  max-width: 420px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 9999;
  opacity: 0;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-banner.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.popup-close:hover {
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  transform: rotate(90deg);
}

.popup-gradient-bar {
  height: 6px;
  width: 100%;
}

.popup-ig-gradient {
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
}

.popup-default-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.popup-content {
  padding: 28px 24px 24px 24px;
  text-align: center;
}

.popup-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  box-shadow: 0 10px 20px -5px rgba(253, 29, 29, 0.3);
}

.popup-icon {
  width: 32px;
  height: 32px;
}

.popup-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.popup-handle {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e1306c;
  margin-bottom: 12px;
}

.popup-description {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 20px;
}

.popup-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 8px 16px -4px rgba(225, 48, 108, 0.4);
  transition: all 0.25s ease;
}

.popup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgba(225, 48, 108, 0.5);
  opacity: 0.95;
}

.popup-dismiss-text {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 14px;
}