:root {
  /* Light Mode Colors */
  --primary-light: #6366F1;
  --primary-light-light: #818CF8;
  --primary-light-dark: #4F46E5;
  --secondary-light: #10B981;
  --secondary-light-light: #34D399;
  --secondary-light-dark: #059669;
  --accent-light: #F59E0B;
  --accent-light-light: #FBBF24;
  --danger-light: #EF4444;
  --light-light: #F9FAFB;
  --dark-light: #1F2937;
  --darker-light: #111827;
  --gray-light: #6B7280;
  --light-gray-light: #E5E7EB;
  --dark-gray-light: #374151;

  /* Dark Mode Colors */
  --primary-dark: #8B5CF6;
  --primary-dark-light: #A78BFA;
  --primary-dark-dark: #7C3AED;
  --secondary-dark: #10B981;
  --secondary-dark-light: #34D399;
  --secondary-dark-dark: #059669;
  --accent-dark: #F59E0B;
  --accent-dark-light: #FBBF24;
  --danger-dark: #EF4444;
  --light-dark: #1F2937;
  --darker-dark: #111827;
  --gray-dark: #9CA3AF;
  --light-gray-dark: #4B5563;
  --dark-gray-dark: #1F2937;

  /* Current Mode Variables */
  --primary: var(--primary-light);
  --primary-light: var(--primary-light-light);
  --primary-dark: var(--primary-light-dark);
  --secondary: var(--secondary-light);
  --secondary-light: var(--secondary-light-light);
  --secondary-dark: var(--secondary-light-dark);
  --accent: var(--accent-light);
  --accent-light: var(--accent-light-light);
  --danger: var(--danger-light);
  --light: var(--light-light);
  --dark: var(--dark-light);
  --darker: var(--darker-light);
  --gray: var(--gray-light);
  --light-gray: var(--light-gray-light);
  --dark-gray: var(--dark-gray-light);

  /* Status colors */
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;

  --neon-blue: #00F5FF;
  --neon-purple: #A855F7;
  --neon-pink: #EC4899;

  --card-bg: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --text-primary: var(--dark-light);
  --text-secondary: var(--gray-light);
  --bg-primary: var(--light-light);
  --bg-secondary: #FFFFFF;
}

/* Dark Mode Variables */
.dark-mode {
  --primary: var(--primary-dark);
  --primary-light: var(--primary-dark-light);
  --primary-dark: var(--primary-dark-dark);
  --secondary: var(--secondary-dark);
  --secondary-light: var(--secondary-dark-light);
  --secondary-dark: var(--secondary-dark-dark);
  --accent: var(--accent-dark);
  --accent-light: var(--accent-dark-light);
  --danger: var(--danger-dark);
  --light: var(--light-dark);
  --dark: var(--dark-dark);
  --darker: var(--darker-dark);
  --gray: var(--gray-dark);
  --light-gray: var(--light-gray-dark);
  --dark-gray: var(--dark-gray-dark);

  --card-bg: rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #FFFFFF;
  --text-secondary: var(--gray-dark);
  --bg-primary: var(--darker-dark);
  --bg-secondary: var(--light-dark);
}

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

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

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

.app-container {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100vw;
}

/* Background Elements */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  z-index: -1;
  background-image: 
      linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

.bg-circle {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent);
  z-index: -1;
  animation: float 6s ease-in-out infinite;
}

.circle-1 {
  width: 300px;
  height: 300px;
  top: 10%;
  right: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 200px;
  height: 200px;
  bottom: 20%;
  left: 5%;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.logo-image {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    display: block;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-title span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
  display: block;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle, .user-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover, .user-icon:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* Navigation */
.nav-container {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--glass-border);
  padding: 0.5rem;
  z-index: 100;
}

@media (max-width: 768px) {
  .nav-container {
      display: flex;
      justify-content: space-around;
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
}

.nav-item.active {
  color: var(--primary);
  background: var(--glass-bg);
}

.nav-item:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-text {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.page {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.page.active {
  display: block;
}

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

/* Section Titles */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title i {
  color: var(--primary);
  font-size: 2.5rem;
}

.neon-text {
  background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Class Cards */
.class-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.class-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.class-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

.class-card i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.class-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Test Type Cards */
.test-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.test-type-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.test-type-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
}

.test-type-card i {
  font-size: 2.5rem;
  color: var(--primary);
}

.test-type-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.test-type-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Performance Card */
.performance-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}

.performance-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.performance-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Attractive Premium Button */
.btn-premium.attractive-premium {
    background: linear-gradient(135deg, #FFD700, #FFA500, #FF6B35);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    animation: premium-pulse 2s ease-in-out infinite;
    position: relative;
    margin: 1rem 0;
    width: 100%;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: visible;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.btn-premium.attractive-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #FFE55C, #FFB347, #FF7F50);
    animation-play-state: paused;
}

.btn-premium.attractive-premium .premium-highlight {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #FF1744;
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    animation: gentle-bounce 2s ease-in-out infinite;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 23, 68, 0.3);
}

@keyframes premium-pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
        transform: translateY(0) scale(1);
    }
    50% {
        box-shadow: 0 10px 30px rgba(255, 215, 0, 0.6);
        transform: translateY(-1px) scale(1.02);
    }
}

@keyframes gentle-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-2px) scale(1.05);
    }
    60% {
        transform: translateY(-1px) scale(1.02);
    }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-border);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--glass-border);
}

.btn-outline:hover {
  background: var(--glass-bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
  box-sizing: border-box;
  overflow-y: auto;
}

/* Promo Code Message Styles */
.message {
  padding: 0;
  border-radius: 8px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 0;
  opacity: 0;
}

.message.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--secondary);
  padding: 0.75rem;
  opacity: 1;
}

.message.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 0.75rem;
  opacity: 1;
}

/* Enhanced Support Modal Styles */
.support-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.support-header::before {
  content: '';
  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.support-header h2 {
  color: var(--text-primary);
  margin: 1rem 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.support-header p {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

.support-options {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.support-option {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.support-option::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.6s ease;
}

.support-option:hover {
  background: var(--card-bg);
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
}

.support-option:hover::before {
  left: 100%;
}

.support-option:active {
  transform: translateY(-3px);
}

.support-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
  flex-shrink: 0;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.support-option:hover .support-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
}

.support-text {
  flex: 1;
  z-index: 1;
}

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

.support-option:hover .support-text h3 {
  color: var(--primary);
}

.support-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Enhanced Support Button */
.support-contact-btn {
  background: linear-gradient(135deg, #0088cc, #0077b5);
  color: white;
  border: none;
  padding: 1.25rem 2rem;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 136, 204, 0.3);
  min-width: 250px;
  justify-content: center;
}

.support-contact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0099dd, #0088cc);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.support-contact-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 136, 204, 0.4);
}

.support-contact-btn:hover::before {
  opacity: 1;
}

.support-contact-btn i {
  font-size: 1.3rem;
  z-index: 1;
}

.support-contact-btn span {
  z-index: 1;
}

.support-contact-btn:active {
  transform: translateY(-1px);
}

/* Profile Support Button Enhancement */
.profile-actions .btn-secondary {
  background: linear-gradient(135deg, var(--glass-bg), var(--card-bg));
  border: 2px solid var(--glass-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.profile-actions .btn-secondary::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;
}

.profile-actions .btn-secondary:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.profile-actions .btn-secondary:hover::before {
  left: 100%;
}

.modal.show {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 16px;
  max-width: 450px;
  width: 100%;
  max-height: 90vh;
  border: 1px solid var(--glass-border);
  box-sizing: border-box;
  overflow-y: auto;
  margin: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Mobile optimizations for modals */
@media (max-width: 768px) {
  .modal {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    max-height: 95vh;
    padding: 1.5rem;
    border-radius: 16px;
    margin: 0;
  }

  .support-header h2 {
    font-size: 1.5rem;
  }

  .support-header p {
    font-size: 0.9rem;
  }

  .support-option {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem;
  }

  .support-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .support-text h3 {
    font-size: 1rem;
  }

  .support-text p {
    font-size: 0.85rem;
  }

  .support-contact-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 0.25rem;
    padding-top: 1rem;
  }

  .modal-content {
    padding: 1rem;
    border-radius: 8px;
  }

  .support-header {
    margin-bottom: 1rem;
  }

  .support-header h2 {
    font-size: 1.2rem;
  }

  .support-options {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .support-option {
    padding: 0.6rem;
  }

  .support-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  text-align: center;
  font-size: 1.5rem;
}

.modal-content h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.modal-content input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 1rem;
  box-sizing: border-box;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary);
}

.modal-content button {
  width: 100%;
  margin-bottom: 1rem;
  min-height: 44px;
}

.modal-content p {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

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

.modal-content a:hover {
  text-decoration: underline;
}

/* Premium modal specific styles */
.premium-modal .modal-content {
  max-width: 500px;
}

.premium-content {
  text-align: center;
}

.premium-header h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.premium-features {
  margin: 1.5rem 0;
}

.premium-features ul {
  text-align: left;
  margin: 0;
  padding-left: 1rem;
}

.premium-features li {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.premium-pricing .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0;
}

/* Mobile optimizations for modals */
@media (max-width: 768px) {
  .modal-content h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .modal-content h3 {
    font-size: 1.1rem;
  }

  .modal-content input {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .premium-header h2 {
    font-size: 1.5rem;
  }

  .premium-features {
    margin: 1rem 0;
  }

  .premium-features li {
    font-size: 0.85rem;
  }

  .premium-pricing .price {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .modal-content h2 {
    font-size: 1.2rem;
  }

  .modal-content h3 {
    font-size: 1rem;
  }

  .modal-content input {
    padding: 0.7rem;
    font-size: 0.9rem;
  }

  .modal-content p {
    font-size: 0.85rem;
  }

  .premium-header h2 {
    font-size: 1.3rem;
  }

  .premium-pricing .price {
    font-size: 1.2rem;
  }
}

/* Quiz Grid */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.quiz-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.quiz-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.2);
}

.quiz-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

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

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Search */
.search-container {
  margin-bottom: 2rem;
}

.search-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Test View */
.test-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--glass-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.test-view-container {
  background: var(--glass-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.iframe-container {
  width: 100%;
  height: 70vh;
  border: none;
  background: white;
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--glass-bg);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.timer i {
  color: var(--primary);
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--glass-border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.subject-performance {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subject-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.8rem 0;
    padding: 0.5rem 0;
}

.subject-name {
    min-width: 80px;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.percentage {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--secondary);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.recent-tests {
    max-height: 200px;
    overflow-y: auto;
}

.test-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.test-item-info h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.test-item-info p {
    margin: 0.2rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.test-score {
    font-weight: bold;
    color: var(--secondary);
}

.improvement-trend {
    padding: 1rem 0;
}

.trend-chart {
    display: flex;
    align-items: end;
    justify-content: space-around;
    height: 120px;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trend-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px 4px 0 0;
    min-height: 10px;
    position: relative;
    display: flex;
    align-items: end;
    justify-content: center;
}

.trend-score {
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.subject-stat span:first-child {
  min-width: 80px;
  font-weight: 600;
  color: var(--text-primary);
}

.subject-stat span:last-child {
  min-width: 40px;
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--glass-border);
  border-radius: 4px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease;
}

/* Profile */
.profile-container {
  max-width: 600px;
  margin: 0 auto;
}

.profile-card {
  text-align: center;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
}

.profile-info {
  flex: 1;
  text-align: left;
}

.profile-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.profile-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.subscription-status {
  display: inline-block;
}

.status-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.trial {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}

.status-badge.premium {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: white;
}

.status-badge.expired {
  background: linear-gradient(135deg, var(--danger), #ff6b6b);
  color: white;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

/* Enhanced Profile Page Styles */
.profile-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.profile-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.profile-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.profile-picture-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.profile-info h3 {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.profile-info p {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

.subscription-status {
  display: inline-block;
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.trial {
  background: linear-gradient(135deg, var(--warning), #ffa726);
  color: white;
}

.status-badge.premium {
  background: linear-gradient(135deg, var(--secondary), #4caf50);
  color: white;
}

.status-badge.expired {
  background: linear-gradient(135deg, var(--danger), #ff6b6b);
  color: white;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-section {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

.profile-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.profile-section h4 i {
  color: var(--primary);
}

.edit-form {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-input[readonly] {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-input[readonly]:focus {
  box-shadow: none;
  border-color: var(--border-color);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.preference-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-color);
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.info-grid {
  display: grid;
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.info-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Responsive Design for Profile */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .info-item {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* Enhanced Quiz Pages */
.quiz-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Professional Quiz Header */
.quiz-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 100;
}

.quiz-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}



.header-title h1 {
  font-size: 1.4rem;
  color: white;
  margin: 0;
  font-weight: 600;
}

.header-title span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.quiz-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.timer-container {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem;
  backdrop-filter: blur(10px);
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 600;
  padding: 0.5rem 1rem;
}

.timer i {
  color: rgba(255, 255, 255, 0.9);
}

.control-buttons {
  display: flex;
  gap: 1rem;
}

.control-buttons .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.home-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.home-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px);
}

.submit-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light)) !important;
  color: white !important;
  border: none !important;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.4);
}

/* Enhanced Sidebar Navigation */
.question-nav {
  width: 380px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transform: translateX(-100%);
  backdrop-filter: blur(20px);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.question-nav.open {
  transform: translateX(0);
}

@media (max-width: 480px) {
  .question-nav {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .nav-header {
    padding: 1rem;
    min-height: 60px;
  }

  .nav-title h3 {
    font-size: 1rem;
  }

  .nav-title i {
    font-size: 1.1rem;
  }

  .nav-close {
    min-width: 48px;
    min-height: 48px;
    padding: 0.6rem;
    font-size: 1.3rem;
    background: #fff;
    border: 3px solid #000;
    color: #000;
    font-weight: 900;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  }

  .nav-close:hover {
    background: #f0f0f0;
    transform: scale(1.05);
  }

  .nav-close i {
    font-size: 1.3rem;
    font-weight: 900;
    color: #000;
  }

  .progress-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .stat {
    padding: 0.5rem 0.25rem;
  }

  .stat-value {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }
}

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.nav-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.nav-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.nav-title i {
  font-size: 1.4rem;
}

.nav-close {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #000;
  color: #000;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.4rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.nav-close:hover {
  background: #fff;
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-close:focus {
  outline: 3px solid #000;
  outline-offset: 2px;
}

.nav-close i {
  font-size: 1.4rem;
  font-weight: 900;
  color: #000;
}

.nav-content {
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
  contain: layout style;
}

/* Quiz Progress Section */
.quiz-progress {
  margin-bottom: 1rem;
  background: var(--glass-bg);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.stat {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar-container {
  margin-top: 1rem;
}

.progress-bar {
  height: 8px;
  background: var(--glass-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease;
  border-radius: 4px;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  display: block;
}

/* Subjects Container */
.subjects-container {
  margin-bottom: 1rem;
  flex-shrink: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.subject-section {
  margin-bottom: 0.75rem;
  background: var(--glass-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.subject-section:not(.expanded) .toggle-icon {
  transform: rotate(-90deg);
}

.subject-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--card-bg), var(--glass-bg));
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--glass-border);
  min-height: 45px;
}

.subject-header:hover {
  background: var(--primary);
  color: white;
}

.subject-header span:first-child {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.subject-section.expanded .toggle-icon {
  transform: rotate(180deg);
}

.question-numbers {
  display: none;
  padding: 1rem;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-height: 0;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  transition: max-height 0.3s ease;
}

.subject-section.expanded .question-numbers {
  display: grid;
  max-height: 500px;
}

.question-btn {
  width: 100%;
  height: 35px;
  min-width: 35px;
  min-height: 35px;
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  aspect-ratio: 1;
}

.question-btn:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.question-btn.answered {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  border-color: var(--secondary);
  color: white;
}

.question-btn.current {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.question-btn.marked {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: var(--accent);
  color: white;
}

.question-btn.skipped {
  background: var(--light-gray);
  border-color: var(--gray);
  color: var(--text-secondary);
}

/* Legend */
.legend {
  background: var(--glass-bg);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  margin-top: auto;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.legend h4 {
  margin: 0 0 0.75rem 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.legend-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--glass-border);
}

.legend-color.current {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-color: var(--primary);
}

.legend-color.answered {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  border-color: var(--secondary);
}

.legend-color.marked {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-color: var(--accent);
}

.legend-color.skipped {
  background: var(--light-gray);
  border-color: var(--gray);
}

.legend-item span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  display: none;
  transition: all 0.3s ease;
  touch-action: none;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  display: block;
}

@media (max-width: 480px) {
  .sidebar-overlay {
    background: rgba(0, 0, 0, 0.8);
  }
}

/* Enhanced Question Content */
.question-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: var(--bg-primary);
  position: relative;
  margin-left: 0;
  width: 100%;
  max-width: 100%;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Enhanced Result Styles */
.result-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-bottom: 1px solid var(--border-color);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.result-header-bar .header-title {
  display: flex;
  flex-direction: column;
}

.result-header-bar .app-title {
  font-size: 1.5rem;
  margin: 0;
  color: white;
}

.header-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.enhanced-result-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 120px);
  width: 100%;
  box-sizing: border-box;
}

/* Enhanced Loading Animation */
.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.loading-animation {
  margin-bottom: 2rem;
}

.loading-spinner-large {
  width: 80px;
  height: 80px;
  border: 6px solid var(--light-gray);
  border-top: 6px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

.loading-progress {
  width: 300px;
  margin: 0 auto;
}

.loading-progress .progress-bar {
  height: 6px;
  background: var(--light-gray);
  border-radius: 3px;
  overflow: hidden;
}

.animated-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

.loading-text h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

.loading-text p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  max-width: 300px;
}

.loading-steps .step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--glass-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  width: 100%;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.loading-steps .step.active {
  opacity: 1;
  background: var(--primary);
  color: white;
  transform: translateX(10px);
}

.loading-steps .step.completed {
  opacity: 0.8;
  background: var(--secondary);
  color: white;
}

.loading-steps .step i {
  font-size: 1.2rem;
}

/* Enhanced Result Content */
.result-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--glass-bg);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

.result-badge {
  margin-bottom: 1.5rem;
}

.badge-icon {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.badge-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
}

.result-title h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.completion-time {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Score Dashboard */
.score-dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.main-score-card {
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.score-circle-container {
  margin-bottom: 1.5rem;
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0deg, var(--light-gray) 0deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 1s ease;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: 10px;
  background: var(--bg-secondary);
  border-radius: 50%;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  z-index: 1;
}

.score-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  z-index: 1;
}

.performance-grade {
  text-align: center;
}

.grade-letter {
  font-size: 3rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.grade-description {
  color: var(--text-secondary);
  font-size: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--glass-bg);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card.correct .stat-icon {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: white;
}

.stat-card.incorrect .stat-icon {
  background: linear-gradient(135deg, var(--danger), #ff6b6b);
  color: white;
}

.stat-card.skipped .stat-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
}

.stat-card.total .stat-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

/* Enhanced Subject Analysis */
.analysis-dashboard {
  margin-bottom: 3rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-primary);
  font-size: 1.8rem;
}

.subject-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.subject-card.enhanced {
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.subject-card.enhanced:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.subject-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.subject-info h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.subject-info p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
}

.subject-score {
  text-align: right;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.percentage {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.performance-indicator {
  font-size: 1.5rem;
}

.performance-indicator.excellent {
  color: var(--secondary);
}

.performance-indicator.good {
  color: var(--primary);
}

.performance-indicator.average {
  color: var(--accent);
}

.performance-indicator.poor {
  color: var(--danger);
}

.subject-progress-container {
  margin-bottom: 1.5rem;
}

.progress-bar.enhanced {
  height: 12px;
  background: var(--light-gray);
  border-radius: 6px;
  overflow: hidden;
}

.subject-breakdown {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breakdown-item i {
  font-size: 1rem;
}

.breakdown-item.correct i {
  color: var(--secondary);
}

.breakdown-item.incorrect i {
  color: var(--danger);
}

.breakdown-item.skipped i {
  color: var(--accent);
}

/* Action Dashboard */
.action-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.action-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}

.btn.enhanced {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn.enhanced:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quiz-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-width: 44px;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.hamburger:active {
  transform: scale(0.95);
}

.hamburger:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.hamburger img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
}

/* Hamburger animation effects */
.hamburger::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.hamburger:hover::before {
  left: 100%;
}

/* Always show hamburger menu */
@media (min-width: 769px) {
  .hamburger {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
    padding: 0.6rem;
    min-width: 44px;
    min-height: 44px;
  }

  .hamburger img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .hamburger {
    padding: 0.5rem;
    min-width: 36px;
    min-height: 36px;
  }

  .hamburger img {
    width: 18px;
    height: 18px;
  }
}

.quiz-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.quiz-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.question-nav {
  width: 300px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transition: all 0.3s ease;
}

.nav-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.nav-close:hover {
  background: var(--bg-tertiary);
}

.subject-section {
  border-bottom: 1px solid var(--border);
}

.subject-header {
  padding: 1rem;
  background: var(--bg-tertiary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  transition: all 0.3s ease;
}

.subject-header:hover {
  background: var(--bg-primary);
}

.question-numbers {
  display: none;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0.5rem;
}

.subject-section.expanded .question-numbers {
  display: grid;
}

.question-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-btn:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.question-btn.current {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.question-btn.answered {
  border-color: var(--secondary);
  background: var(--secondary);
  color: white;
}

.question-btn.marked {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.question-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: var(--bg-primary);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.question-number {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.subject-badge {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.question-body {
  margin-bottom: 2rem;
  text-align: center;
}

.question-text {
  margin-bottom: 1.5rem;
}

.question-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.question-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1rem auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: block;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.option:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
}

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

.option-letter {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

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

.option-text {
  font-size: 1rem;
  line-height: 1.5;
  flex: 1;
}

.integer-answer {
  margin: 1rem auto;
  max-width: 400px;
  text-align: center;
}

.integer-answer label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.integer-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  text-align: center;
}

.integer-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.question-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  /* Global mobile optimizations */
  body {
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .app-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Header optimizations */
  header {
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .logo-container {
    gap: 0.5rem;
  }

  .logo-image {
    width: 36px;
    height: 36px;
  }

  .app-title {
    font-size: 1.1rem;
  }

  .app-title span {
    font-size: 0.7rem;
  }

  /* Navigation optimizations */
  .nav-container {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 0.5rem;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }

  .nav-item {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    min-height: 60px;
    justify-content: center;
  }

  .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
  }

  .nav-text {
    font-size: 0.7rem;
    font-weight: 500;
  }

  /* Main content padding for bottom nav */
  main {
    padding: 1rem;
    padding-bottom: 90px; /* Space for bottom navigation */
  }

  /* Quiz header mobile optimizations */
  .quiz-header {
    padding: 0.75rem 1rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .quiz-nav {
    flex: 1;
    min-width: 0;
  }

  .hamburger {
    display: flex !important;
    margin-right: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0.6rem;
  }

  .quiz-controls {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .timer-container {
    order: 3;
    width: 100%;
    margin-top: 0.5rem;
  }

  .control-buttons {
    gap: 0.5rem;
  }

  .control-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  /* Question navigation mobile optimizations */
  .question-nav {
    width: 90vw;
    max-width: 400px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .question-nav.open {
    transform: translateX(0);
  }

  .nav-content {
    padding: 0.75rem;
  }

  .question-numbers {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    padding: 0.75rem;
  }

  .question-btn {
    width: 100%;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 0.9rem;
    touch-action: manipulation;
    border-radius: 8px;
  }

  .subjects-container {
    margin-bottom: 0.75rem;
  }

  .legend-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .quiz-progress {
    padding: 0.75rem;
  }

  .legend {
    padding: 0.75rem;
  }

  /* Question content mobile optimizations */
  .question-content {
    padding: 1rem;
    width: 100%;
    margin-left: 0;
    padding-bottom: 120px; /* Extra space for navigation */
  }

  .question-header {
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    border-radius: 12px;
    margin-bottom: 1.5rem;
  }

  .question-text {
    font-size: 1rem;
    line-height: 1.6;
    padding: 1rem;
  }

  .question-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
  }

  /* Options mobile optimizations */
  .options {
    gap: 1rem;
    margin: 1.5rem 0;
  }

  .option {
    padding: 1rem;
    font-size: 1rem;
    min-height: 60px;
    border-radius: 12px;
    touch-action: manipulation;
  }

  .option-letter {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .integer-input {
    padding: 1rem;
    font-size: 1.1rem;
    min-height: 50px;
    border-radius: 8px;
  }

  /* Question actions mobile optimizations */
  .question-actions {
    gap: 0.75rem;
    flex-wrap: wrap;
    position: sticky;
    bottom: 20px;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
  }

  .question-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    font-size: 0.9rem;
    min-height: 48px;
    border-radius: 8px;
  }

  /* Cards and grids mobile optimizations */
  .class-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .class-card {
    padding: 1.5rem 1rem;
    min-height: 120px;
  }

  .class-card i {
    font-size: 2.5rem;
  }

  .test-types {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .test-type-card {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .quiz-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .quiz-card {
    padding: 1.5rem;
    border-radius: 12px;
  }

  /* Performance stats mobile optimizations */
  .performance-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .stat-item {
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
  }

  .stat-value {
    font-size: 1.25rem;
    line-height: 1.2;
    word-break: break-all;
  }

  .stat-label {
    font-size: 0.75rem;
    line-height: 1.3;
    word-break: break-word;
    hyphens: auto;
  }

  /* Profile mobile optimizations */
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .profile-avatar {
    width: 100px;
    height: 100px;
  }

  .profile-info {
    text-align: center;
  }

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .info-item {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1rem;
  }

  /* Results page mobile optimizations */
  .score-dashboard {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .subject-analysis-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .action-dashboard {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Review page mobile optimizations */
  .review-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .review-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .view-options {
    justify-content: center;
  }

  .review-progress {
    flex-direction: column;
    gap: 1rem;
  }

  .navigation-controls {
    justify-content: center;
  }

  .answer-comparison {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .questions-grid {
    grid-template-columns: 1fr;
  }

  .jump-to-question {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .review-actions {
    flex-direction: column;
  }

  .review-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Search optimizations */
  .search-input {
    padding: 1rem;
    font-size: 1rem;
    border-radius: 8px;
  }

  /* Button optimizations for touch */
  .btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    touch-action: manipulation;
  }

  .btn i {
    font-size: 1.1rem;
  }

  /* Modal optimizations */
  .modal-content {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
    border-radius: 12px;
  }

  /* Analytics mobile optimizations */
  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .performance-card {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .subject-stat {
    margin: 0.75rem 0;
    padding: 0.5rem 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .subject-name {
    min-width: 60px;
    max-width: 80px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .progress-bar {
    flex: 1;
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    min-width: 60px;
  }

  .percentage {
    min-width: 35px;
    text-align: right;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  /* Theme toggle and user actions */
  .user-actions {
    gap: 0.5rem;
  }

  .theme-toggle, .user-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
  }

  /* Fix analytics page specific issues */
  #analytics-page .performance-card {
    margin: 0 0 1rem 0;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  #analytics-page .performance-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    word-break: break-word;
  }

  .subject-performance {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Ensure no content extends beyond viewport */
  .recent-tests {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .test-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.75rem;
    margin: 0.5rem 0;
  }

  .test-item-info h4 {
    font-size: 0.9rem;
    margin: 0;
    word-break: break-word;
  }

  .test-item-info p {
    font-size: 0.75rem;
    margin: 0.2rem 0 0 0;
  }
}

@media (max-width: 480px) {
    /* Extra small mobile optimizations */
    body {
        font-size: 13px;
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
    }

    .app-container {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        padding: 0;
        margin: 0;
    }

    main {
        padding: 0.75rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Analytics specific fixes for very small screens */
    .performance-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .subject-stat {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
        background: var(--card-bg);
        border-radius: 8px;
        margin: 0.5rem 0;
    }

    .subject-name {
        min-width: auto;
        max-width: 100%;
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .progress-bar {
        width: 100%;
        margin: 0.25rem 0;
    }

    .percentage {
        align-self: flex-end;
        font-size: 0.9rem;
    }

    .quiz-header {
        padding: 0.5rem 0.75rem;
    }

    .header-title h1 {
        font-size: 1rem;
    }

    .header-title span {
        display: none;
    }

    .ai-quiz-maker-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 20px;
    }

    .ai-quiz-maker-btn i {
        font-size: 1rem;
    }

    .test-view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .test-view-header h2 {
        text-align: center;
        margin: 0;
    }

    .empty-state {
        padding: 1.5rem 1rem;
    }

    .empty-state .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--light-gray);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.improvement-trend h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* Upload Status Styles */
.upload-status {
  margin-top: 2rem;
}

.status-item {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.status-item.processing {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary);
}

.status-item.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--secondary);
}

.status-item.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(248, 113, 113, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.status-item i {
  font-size: 1.2rem;
}

/* AI Quiz Maker Styles */
.ai-quiz-maker-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-quiz-maker-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.ai-quiz-maker-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

.ai-quiz-maker-btn:hover::before {
    left: 100%;
}

.ai-quiz-maker-btn i {
    font-size: 1.2rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

/* AI Quiz Modal Styles */
.ai-quiz-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.ai-quiz-header::before {
    content: '';
    position: absolute;
    top: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.ai-quiz-header h2 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-quiz-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-highlight {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-highlight::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.6s ease;
}

.feature-highlight:hover {
    background: var(--card-bg);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.2);
}

.feature-highlight:hover::before {
    left: 100%;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8rem;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.feature-highlight:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.4);
}

.feature-text {
    flex: 1;
    z-index: 1;
}

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

.feature-highlight:hover .feature-text h3 {
    color: var(--primary);
}

.feature-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ai-quiz-btn {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
    min-width: 250px;
    justify-content: center;
}

.ai-quiz-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--secondary-light), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
    text-decoration: none;
    color: white;
}

.ai-quiz-btn:hover::before {
    opacity: 1;
}

.ai-quiz-btn i {
    font-size: 1.3rem;
    z-index: 1;
}

.ai-quiz-btn span {
    z-index: 1;
}

.ai-quiz-btn:active {
    transform: translateY(-1px);
}

/* Mobile responsiveness for AI Quiz Maker */
@media (max-width: 768px) {
    .section-title {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .ai-quiz-maker-btn {
        margin-left: 0;
        align-self: flex-start;
    }

    .feature-highlight {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .ai-quiz-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-width: 200px;
    }
}

/* Enhanced Footer Styles */
.enhanced-footer {
    background: linear-gradient(135deg, #1a365d, #2d3748);
    color: white;
    margin-top: 4rem;
    overflow: hidden;
    position: relative;
}

.enhanced-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 4rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-section h4 {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.footer-section a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
}

.footer-section a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-section a:hover::before {
    width: 100%;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright p {
    margin: 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.developer-credit a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.developer-credit a::before {
    content: 'Ã°Å¸â€™Â»';
    font-size: 1rem;
}

.developer-credit a:hover {
    color: var(--secondary-light);
    transform: scale(1.05);
}

/* Mobile Footer Responsiveness */
@media (max-width: 768px) {
  .enhanced-footer {
    margin-top: 2rem;
  }

  .payment-icons {
    gap: 1rem;
    flex-direction: column;
  }

  .payment-icons > div {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
    text-align: center;
  }

  .footer-section h4 {
    text-align: center;
    margin-bottom: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .developer-credit a {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .payment-icons {
    gap: 0.75rem;
  }

  .payment-icons span {
    font-size: 0.8rem;
  }

  .footer-content {
    padding: 1.5rem 1rem;
  }

  .footer-section h4 {
    font-size: 1rem;
  }

  .footer-section a {
    font-size: 0.9rem;
  }

  .copyright p {
    font-size: 0.8rem;
  }

  .developer-credit a {
    font-size: 0.8rem;
  }
}

/* App Download Popup */
.app-download-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-download-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.app-download-popup {
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.app-download-overlay.show .app-download-popup {
  transform: scale(1);
}

.app-download-content {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 350px;
  width: 90vw;
  position: relative;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: slideIn 0.3s ease;
}

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

.app-download-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
}

.app-download-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.app-download-close .material-icons {
  font-size: 20px;
}

.app-download-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.app-download-icon .material-icons {
  font-size: 32px;
  color: white;
}

.app-download-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.app-download-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.app-download-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.app-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.app-download-btn:active {
  transform: translateY(0);
}

.app-download-btn .material-icons {
  font-size: 20px;
}

/* Dark mode adjustments */
.dark-mode .app-download-content {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .app-download-content {
    padding: 1.5rem;
    max-width: 320px;
  }

  .app-download-content h3 {
    font-size: 1.1rem;
  }

  .app-download-content p {
    font-size: 0.85rem;
  }

  .app-download-icon {
    width: 50px;
    height: 50px;
  }

  .app-download-icon .material-icons {
    font-size: 28px;
  }

  .app-download-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
  }
}