html,
body {
  height: 100%;
  width: 100%;
  background-color: #ffffff;
}

body.theme-dark {
  background-color: #111;
}

/* Modern Quiz Preloader */
.preloader {
  position: fixed;
  inline-size: 100%;
  block-size: 100%;
  background: linear-gradient(135deg, #7733fe 0%, #5e35af 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.theme-dark .preloader {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

@media (max-width: 1199px) {
  .header {
    display: none;
  }
}

.preloader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
  position: relative;
}

.preloader-logo-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: logoFloat 3s ease-in-out infinite;
}

.preloader-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  animation: logoRotate 4s linear infinite;
}

.theme-dark .preloader-img {
  filter: brightness(0) invert(1);
}

.preloader-title {
  font-family: "Roboto", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  letter-spacing: -0.02em;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

.preloader-subtitle {
  font-family: "Roboto", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  letter-spacing: 0.05em;
  animation: subtitleFade 3s ease-in-out infinite;
}

.quiz-loader {
  position: relative;
  width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  overflow: hidden;
  margin-top: 1rem;
}

.quiz-loader::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffffff, #f0f0f0, #ffffff);
  border-radius: 50px;
  animation: quizProgress 2.5s ease-in-out infinite;
}

.quiz-dots {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
}

.quiz-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  animation: dotPulse 1.5s ease-in-out infinite;
}

.quiz-dot:nth-child(1) {
  animation-delay: 0s;
}
.quiz-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.quiz-dot:nth-child(3) {
  animation-delay: 0.4s;
}
.quiz-dot:nth-child(4) {
  animation-delay: 0.6s;
}

.preloader-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: particleFloat 8s linear infinite;
}

.particle:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
}
.particle:nth-child(2) {
  left: 20%;
  animation-delay: 1s;
}
.particle:nth-child(3) {
  left: 30%;
  animation-delay: 2s;
}
.particle:nth-child(4) {
  left: 40%;
  animation-delay: 3s;
}
.particle:nth-child(5) {
  left: 50%;
  animation-delay: 4s;
}
.particle:nth-child(6) {
  left: 60%;
  animation-delay: 5s;
}
.particle:nth-child(7) {
  left: 70%;
  animation-delay: 6s;
}
.particle:nth-child(8) {
  left: 80%;
  animation-delay: 7s;
}
.particle:nth-child(9) {
  left: 90%;
  animation-delay: 8s;
}

/* Additional visual enhancements */
.preloader-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: backgroundPulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes backgroundPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Loading text animation */
.preloader-subtitle::after {
  content: "";
  animation: loadingDots 2s infinite;
}

@keyframes loadingDots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

.header {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 100%;
}
.header-container {
  max-inline-size: 1200px;
  margin-inline: auto;
  padding: 1.28rem 1.6rem;
  background-color: #fff;
  box-shadow: 0px 6px 12px -3px rgba(4, 97, 165, 0.1);
  border-radius: 0 0 0.625rem 0.625rem;
}

.theme-dark .header-container {
  background-color: #111;
}
.header .logo {
  max-height: 30px;
}
.placeholder {
  block-size: 0.825rem;
  inline-size: 3rem;
  background-color: #f5f5f5;
  border-radius: 0.3rem;
}

.theme-dark .placeholder {
  background-color: #111;
}

.placeholder-wide {
  inline-size: 12rem;
}

.d-flex {
  display: flex;
}
.align-items-center {
  align-items: center;
}
.justify-content-center {
  justify-content: center;
}
.justify-content-between {
  justify-content: space-between;
}
.flex-column {
  flex-direction: column;
}
.gap-3 {
  gap: 1rem;
}
.gap-4 {
  gap: 1.5rem;
}
.gap-5 {
  gap: 3rem;
}
/* Modern Quiz Preloader Animations */
@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0px) scale(1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }
  50% {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  }
}

@keyframes logoRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes titleGlow {
  0% {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    transform: scale(1);
  }
  100% {
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8),
      0 0 40px rgba(119, 51, 254, 0.5);
    transform: scale(1.02);
  }
}

@keyframes subtitleFade {
  0%,
  100% {
    opacity: 0.8;
    transform: translateY(0px);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes quizProgress {
  0% {
    width: 0%;
    opacity: 1;
  }
  50% {
    width: 70%;
    opacity: 0.8;
  }
  100% {
    width: 100%;
    opacity: 0.6;
  }
}

@keyframes dotPulse {
  0%,
  100% {
    transform: scale(1);
    background: rgba(255, 255, 255, 0.3);
  }
  50% {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.8);
  }
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .preloader-title {
    font-size: 2rem;
  }

  .preloader-subtitle {
    font-size: 0.9rem;
  }

  .preloader-logo-container {
    width: 100px;
    height: 100px;
  }

  .preloader-img {
    width: 60px;
    height: 60px;
  }

  .quiz-loader {
    width: 160px;
  }
}
