:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --secondary: #0891b2;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --bg-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-animated: linear-gradient(-45deg, #667eea, #764ba2, #06b6d4, #8b5cf6);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --glow-primary: 0 0 20px rgba(99, 102, 241, 0.4)
}

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

html {
  scroll-behavior: smooth
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden
}

/* Floating particles background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  z-index: -1;
  animation: floatBg 20s ease-in-out infinite
}

@keyframes floatBg {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(2%, 2%) scale(1.02);
  }

  50% {
    transform: translate(-1%, 3%) scale(1.01);
  }

  75% {
    transform: translate(1%, -2%) scale(1.03);
  }
}


a {
  color: var(--primary);
  text-decoration: none
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm)
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer
}

.logo-icon {
  width: 45px;
  height: 45px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-md)
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent
}

.logo-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted)
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: all 0.3s ease
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px)
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px)
}

.nav-mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-light);
  z-index: 999;
  padding: 100px 1.5rem 2rem;
  transform: translateX(100%);
  transition: transform 0.4s ease;
  overflow-y: auto
}

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

.nav-mobile ul {
  list-style: none
}

.nav-mobile li {
  margin-bottom: 0.5rem
}

.nav-mobile button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.5rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit
}

.nav-mobile button:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.1)
}

.nav-section-title {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 1.5rem 1.5rem 0.5rem;
  margin-top: 1rem
}

.main {
  padding-top: 90px;
  min-height: 100vh
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem
}

.hero {
  background: var(--bg-hero);
  color: white;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  margin-top: -90px;
  padding-top: calc(90px + 3rem);
  position: relative;
  overflow: hidden
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  color: white;
  margin-bottom: 1.5rem;
  position: relative
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: 1rem;
  position: relative;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2)
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  position: relative
}

.stat-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px)
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: white
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8)
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease
}

.card:hover::before {
  left: 100%
}

.card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
  border-color: var(--primary)
}

.card-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: iconPulse 3s ease-in-out infinite
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4)
}

.card-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
  transition: color 0.3s ease
}

.card:hover .card-title {
  color: var(--primary)
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06)
}

.card-hours {
  color: var(--text-muted);
  font-size: 0.85rem
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden
}

.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease
}

.btn:hover::after {
  left: 100%
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3)
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5)
}


.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid rgba(0, 0, 0, 0.15)
}

.btn-secondary:hover {
  background: #f1f5f9
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem
}

.btn-block {
  width: 100%
}

.content-section {
  display: none;
  animation: fadeIn 0.5s ease
}

.content-section.active {
  display: block
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

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

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(99, 102, 241, 0.2)
}

.section-header h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 0.5rem;
  color: var(--text-primary)
}

.section-header p {
  color: var(--text-secondary)
}

.content-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-sm)
}

.content-card h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem
}

.content-card h4 {
  color: var(--secondary);
  margin: 1rem 0 0.5rem;
  font-size: 1rem
}

.content-card ul {
  list-style: none;
  margin: 0.5rem 0
}

.content-card li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem
}

.content-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold
}

.content-card p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem
}

.info-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.1));
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  border-radius: 0 12px 12px 0;
  margin: 1.5rem 0
}

.info-box.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(234, 88, 12, 0.1));
  border-color: var(--warning)
}

.info-box.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
  border-color: var(--success)
}

.info-box h4 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--text-primary)
}

.test-progress {
  background: rgba(0, 0, 0, 0.08);
  height: 10px;
  border-radius: 5px;
  margin-bottom: 2rem;
  overflow: hidden
}

.test-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 5px;
  transition: width 0.5s ease
}

.question-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: var(--shadow-md)
}

.question-number {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--gradient-primary);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: white
}

.question-text {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  color: var(--text-primary)
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem
}

.option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease
}

.option:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--primary)
}

.option.selected {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary)
}

.option.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success)
}

.option.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger)
}

.option-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--text-primary)
}

.option.selected .option-marker {
  background: var(--primary);
  border-color: var(--primary);
  color: white
}

.option.correct .option-marker {
  background: var(--success);
  border-color: var(--success);
  color: white
}

.option.incorrect .option-marker {
  background: var(--danger);
  border-color: var(--danger);
  color: white
}

.test-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem
}

.result-score {
  font-size: 5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem
}

.result-message {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: var(--text-primary)
}

.result-details {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem
}

.result-stat {
  text-align: center;
  padding: 1rem 2rem;
  background: #f8fafc;
  border-radius: 12px
}

.result-stat-number {
  font-size: 2.5rem;
  font-weight: 700
}

.result-stat-number.correct {
  color: var(--success)
}

.result-stat-number.incorrect {
  color: var(--danger)
}

.result-stat-label {
  color: var(--text-muted);
  font-size: 0.9rem
}

.footer {
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 4rem
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem
}

.footer-info {
  color: var(--text-muted);
  font-size: 0.9rem
}

.text-center {
  text-align: center
}

.mt-3 {
  margin-top: 1.5rem
}

.mt-4 {
  margin-top: 2rem
}

.mb-3 {
  margin-bottom: 1.5rem
}

.hidden {
  display: none !important
}

.back-btn {
  margin-bottom: 1.5rem
}

/* ========== MOBILE RESPONSIVE STYLES ========== */

/* Small screens - ensure voice control buttons are visible */
@media (max-width: 480px) {
  /* Voice control buttons in section header */
  .section-header > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
  }

  .section-header > div > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
  }

  /* Make all control buttons visible and properly sized on mobile */
  .section-header .btn {
    flex: 1 1 calc(50% - 0.5rem) !important;
    min-width: 100px !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
  }

  /* Pause/Resume button specifically */
  #pauseVoiceBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* TTS buttons in content cards */
  .content-card > div:first-child {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .content-card > div:first-child .btn {
    align-self: flex-start !important;
  }

  /* Bottom action buttons */
  .text-center.mt-4 {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .text-center.mt-4 .btn {
    width: 100% !important;
  }
}

/* Medium screens */
@media (max-width: 768px) {
  /* Section header button layout */
  .section-header > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .section-header > div > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .section-header .btn {
    flex: 0 1 auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Ensure TTS control buttons are always visible */
  #pauseVoiceBtn,
  .section-header .btn-secondary {
    display: inline-flex !important;
  }
}

/* Desktop styles */
@media(min-width:768px) {
  .container {
    padding: 3rem 2rem
  }

  .content-card {
    padding: 2rem
  }

  .hero {
    padding: 5rem 2rem 4rem;
    padding-top: calc(90px + 4rem)
  }
}