/* Enhanced Account Management Styles - Dark Mode Only */
:root {
  --primary-color: #FF3600;
  --primary-light: #FF6B00;
  --primary-dark: #E63100;
  --secondary-color: #FFB800;
  --text-dark: #1a1a1a;
  --text-light: #e5e7eb;
  --bg-light: #f9fafb;
  --bg-dark: #1a1a1a;
}

/* Enhanced Loader Animation */
.loader {
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dark Mode Base Styles */
body {
  background-color: #1a1a1a;
  color: #e5e7eb;
}

.bg-white {
  background-color: #1f2937 !important;
}

.text-gray-900 {
  color: #f3f4f6 !important;
}

.text-gray-600 {
  color: #d1d5db !important;
}

.bg-gray-50 {
  background-color: #111827 !important;
}

.bg-gradient-to-br.from-white.via-orange-50.to-white {
  background: linear-gradient(to bottom right, #1f2937, #1a1a1a, #1f2937) !important;
}

.border-gray-300 {
  border-color: #374151 !important;
}

.bg-white\/80 {
  background-color: rgba(31, 41, 55, 0.8) !important;
}

.bg-gray-100\/50 {
  background-color: rgba(17, 24, 39, 0.5) !important;
}

.hover\:bg-gray-100\/50:hover {
  background-color: rgba(17, 24, 39, 0.5) !important;
}

.hover\:text-gray-900:hover {
  color: #f3f4f6 !important;
}

/* Enhanced Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #374151;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Enhanced Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0,-8px,0);
  }
  70% {
    transform: translate3d(0,-4px,0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

.bounce {
  animation: bounce 1s infinite;
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Enhanced Card Hover Effects */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Enhanced Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background-color: #064e3b;
  color: #4ade80;
}

.status-pending {
  background-color: #78350f;
  color: #fbbf24;
}

.status-completed {
  background-color: #1e3a8a;
  color: #60a5fa;
}

.status-cancelled {
  background-color: #374151;
  color: #9ca3af;
}

/* Enhanced Form Styling */
.form-input {
  transition: all 0.3s ease;
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 54, 0, 0.1);
  border-color: #FF3600;
}

/* Enhanced Activity Timeline */
.activity-timeline {
  position: relative;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #FF3600, #FF8C00);
}

.activity-item {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
}

.activity-item::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: 2px solid #1f2937;
  z-index: 1;
}

/* Enhanced AI Chat Styles */
.ai-message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  position: relative;
  backdrop-filter: blur(10px);
}

.ai-message.user {
  background: linear-gradient(135deg, #FF3600, #FF8C00);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 0.25rem;
}

.ai-message.assistant {
  background: linear-gradient(135deg, #374151, #4b5563);
  color: #f3f4f6;
  margin-right: auto;
  border-bottom-left-radius: 0.25rem;
}

.ai-typing {
  display: inline-flex;
  align-items: center;
}

.ai-typing span {
  height: 8px;
  width: 8px;
  background-color: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  margin: 0 1px;
  animation: typing 1s infinite ease-in-out;
}

.ai-typing span:nth-child(1) {
  animation-delay: 0.2s;
}

.ai-typing span:nth-child(2) {
  animation-delay: 0.4s;
}

.ai-typing span:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes typing {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Enhanced Toast Notifications */
.custom-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  color: white;
  z-index: 1000;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #374151;
}

/* Enhanced Memory Game Styles */
.game-mode-card {
  background: #374151;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.game-mode-card:hover {
  border-color: #8B5CF6;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.game-mode-card.selected {
  border-color: #8B5CF6;
  background: rgba(139, 92, 246, 0.2);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.mode-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem;
}

.difficulty-badges {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  color: white;
}

.badge.easy { background-color: #10B981; }
.badge.medium { background-color: #F59E0B; }
.badge.hard { background-color: #F97316; }
.badge.expert { background-color: #EF4444; }
.badge.master { background-color: #8B5CF6; }

.difficulty-option {
  background: #374151;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.difficulty-option:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.difficulty-option.selected {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.difficulty-option.easy.selected { border-color: #10B981; }
.difficulty-option.medium.selected { border-color: #F59E0B; }
.difficulty-option.hard.selected { border-color: #F97316; }
.difficulty-option.expert.selected { border-color: #EF4444; }

.difficulty-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  margin: 0 auto 0.5rem;
}

.difficulty-icon.easy { background-color: #10B981; }
.difficulty-icon.medium { background-color: #F59E0B; }
.difficulty-icon.hard { background-color: #F97316; }
.difficulty-icon.expert { background-color: #EF4444; }

.reward {
  font-size: 0.875rem;
  font-weight: bold;
  color: #34D399;
  margin-top: 0.5rem;
}

/* Advanced Memory Card Styles */
.memory-card {
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.3s;
}

.memory-card:hover {
  transform: scale(1.05);
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card.matched {
  opacity: 0.7;
  cursor: default;
  transform: scale(0.95);
}

.memory-card.hint {
  animation: pulse-hint 1s ease-in-out;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.memory-card-front, .memory-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.memory-card-back {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: white;
  font-size: 1.5rem;
}

.memory-card-front {
  background: linear-gradient(135deg, #374151, #4b5563);
  color: white;
  transform: rotateY(180deg);
  font-size: 1.75rem;
}

/* Sequence Mode Styles */
.sequence-display {
  background: linear-gradient(to right, #3B82F6, #06B6D4);
  padding: 1rem;
  border-radius: 0.5rem;
  color: white;
  text-align: center;
  margin-bottom: 1rem;
}

.sequence-item {
  display: inline-block;
  margin: 0 0.5rem;
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

.sequence-input {
  background: #374151;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 2px dashed #4B5563;
  text-align: center;
  min-height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pattern Mode Styles */
.pattern-grid {
  display: grid;
  gap: 0.25rem;
  background: #4B5563;
  padding: 0.5rem;
  border-radius: 0.5rem;
}

.pattern-cell {
  background: #374151;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pattern-cell.missing {
  background: #7F1D1D;
  border: 2px dashed #EF4444;
}

.pattern-cell.correct {
  background: #064E3B;
  border: 2px solid #22C55E;
}

/* Animations */
@keyframes pulse-hint {
  0%, 100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
}

@keyframes correct-match {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes incorrect-match {
  0% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}

.memory-card.correct-match {
  animation: correct-match 0.5s ease-in-out;
}

.memory-card.incorrect-match {
  animation: incorrect-match 0.5s ease-in-out;
}

/* Performance Feedback Styles */
.performance-excellent {
  background: linear-gradient(to right, #F59E0B, #D97706);
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.performance-good {
  background: linear-gradient(to right, #10B981, #059669);
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.performance-average {
  background: linear-gradient(to right, #3B82F6, #1D4ED8);
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.performance-poor {
  background: linear-gradient(to right, #8B5CF6, #7C3AED);
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

/* Brain Training Stats */
.brain-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .brain-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.brain-stat {
  background: #374151;
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
}

.brain-stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #A78BFA;
}

.brain-stat-label {
  font-size: 0.875rem;
  color: #9CA3AF;
}

/* Enhanced Quiz Styles */
.quiz-option {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.quiz-option:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.quiz-option.correct {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border-color: #047857 !important;
  transform: scale(1.02);
}

.quiz-option.incorrect {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: #b91c1c !important;
  transform: scale(0.98);
}

.quiz-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modern Selector Styles */
.difficulty-option {
  transition: all 0.3s ease;
}

.difficulty-option.easy input:checked ~ span {
  color: #10b981;
}

.difficulty-option.medium input:checked ~ span {
  color: #f59e0b;
}

.difficulty-option.hard input:checked ~ span {
  color: #ef4444;
}

/* Power-up Animations */
@keyframes powerupUsed {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.powerup-used {
  animation: powerupUsed 0.5s ease;
}

/* Language Specific Styles */
.quiz-content-sinhala {
  font-family: 'Noto Sans Sinhala', sans-serif;
  font-size: 1.1em;
  line-height: 1.6;
}

.quiz-content-tamil {
  font-family: system-ui, sans-serif;
  font-size: 1.1em;
  line-height: 1.6;
}

/* Enhanced Progress Bar */
.quiz-progress-bar {
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #3b82f6);
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Difficulty Badges */
.difficulty-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.difficulty-easy {
  background-color: #064e3b;
  color: #4ade80;
}

.difficulty-medium {
  background-color: #78350f;
  color: #fbbf24;
}

.difficulty-hard {
  background-color: #7f1d1d;
  color: #fca5a5;
}

/* Enhanced Timer */
.quiz-timer {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.quiz-timer.warning {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  animation: pulse 1s infinite;
}

/* Question Number Indicator */
.question-indicator {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .quiz-option {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  #quizOptions {
    grid-template-columns: 1fr;
  }
  
  .quiz-timer {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
  }
}

/* Celebration Animations */
@keyframes confettiFall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #3b82f6;
  opacity: 0;
  z-index: 9999;
  animation: confettiFall 3s ease-in-out forwards;
}

/* Score Pop Animation */
@keyframes scorePop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.score-pop {
  animation: scorePop 0.5s ease-out;
}

/* Enhanced Badge Styles */
.badge-item {
  transition: all 0.3s ease;
  text-align: center;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-item:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.badge-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.badge-item:hover .badge-icon {
  transform: scale(1.1) rotate(5deg);
}

.badge-locked {
  opacity: 0.6;
  filter: grayscale(1);
}

.badge-locked .badge-icon {
  background: linear-gradient(135deg, #6b7280, #9ca3af) !important;
}

/* Enhanced Game Animations */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 54, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 54, 0, 0.8), 0 0 30px rgba(255, 54, 0, 0.6);
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.bounce-in {
  animation: bounceIn 0.6s ease-out;
}

.pulse-glow {
  animation: pulseGlow 2s infinite;
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #FF3600;
  opacity: 0;
  z-index: 9999;
  animation: confetti 3s ease-in-out forwards;
}

/* Enhanced Game Section Transitions */
.game-section {
  transition: all 0.5s ease-in-out;
}

/* Enhanced Responsive Game Styles */
@media (max-width: 640px) {
  #memoryGameBoard {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .memory-card {
    height: 70px;
  }
  
  .badge-item {
    margin-bottom: 1rem;
  }
  
  .quiz-option {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
}

/* Enhanced Achievement Popup */
.achievement-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #1f2937, #374151);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  text-align: center;
  animation: bounceIn 0.6s ease-out;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

/* Enhanced Progress Bars */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #374151;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF3600, #FF8C00, #FFB800);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Enhanced Game Buttons */
.game-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #374151;
}

.game-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.game-button:hover::before {
  left: 100%;
}

.game-button:active {
  transform: scale(0.95);
}

/* Enhanced Score Display */
.score-display {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.5rem;
}

/* Enhanced Level Indicators */
.level-indicator {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, #FF3600, #FF8C00);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Enhanced Game Stats */
.game-stats {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.game-stats:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Enhanced Celebration Effects */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confetti 3s ease-in-out forwards;
}

/* Enhanced Game Tutorial */
.tutorial-step {
  position: relative;
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid #FF3600;
  background: linear-gradient(135deg, rgba(255, 54, 0, 0.1), rgba(255, 140, 0, 0.1));
  backdrop-filter: blur(10px);
}

.tutorial-step-number {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #FF3600, #FF8C00);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: bold;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Enhanced AI Quiz Loading */
.ai-quiz-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-quiz-loading .loader {
  margin-bottom: 1rem;
  border-top-color: #3b82f6;
}

/* Enhanced Puzzle Game Styles */
.puzzle-piece {
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    font-weight: bold;
}

.puzzle-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #FF3600;
}

.puzzle-piece.empty {
    background: transparent !important;
    cursor: default;
    box-shadow: none;
    border: 2px dashed #9ca3af;
}

.puzzle-piece.empty:hover {
    transform: none;
    border-color: #9ca3af;
}

.puzzle-piece.correct {
    border-color: #10b981 !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.puzzle-piece.hint {
    animation: pulseGlow 1s infinite;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.7);
}

/* Puzzle Animations */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.puzzle-container {
    animation: slideIn 0.5s ease-out;
}

/* Performance Feedback Styles */
.performance-excellent {
    background: linear-gradient(to right, #F59E0B, #D97706);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.performance-good {
    background: linear-gradient(to right, #10B981, #059669);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.performance-average {
    background: linear-gradient(to right, #3B82F6, #1D4ED8);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.performance-poor {
    background: linear-gradient(to right, #8B5CF6, #7C3AED);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

/* Brain Training Stats */
.brain-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .brain-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.brain-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.brain-stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #A78BFA;
}

.brain-stat-label {
    font-size: 0.875rem;
    color: #E5E7EB;
}

/* Game Mode Cards */
.game-mode-card {
    background: #374151;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-mode-card:hover {
    border-color: #8B5CF6;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.game-mode-card.selected {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.mode-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem;
}

.difficulty-badges {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    color: white;
}

.badge.easy { background-color: #10B981; }
.badge.medium { background-color: #F59E0B; }
.badge.hard { background-color: #F97316; }
.badge.expert { background-color: #EF4444; }
.badge.master { background-color: #8B5CF6; }

/* Difficulty Options */
.difficulty-option {
    background: #374151;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.difficulty-option:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.difficulty-option.selected {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.difficulty-option.easy.selected { border-color: #10B981; }
.difficulty-option.medium.selected { border-color: #F59E0B; }
.difficulty-option.hard.selected { border-color: #F97316; }
.difficulty-option.expert.selected { border-color: #EF4444; }

.difficulty-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    margin: 0 auto 0.5rem;
}

.difficulty-icon.easy { background-color: #10B981; }
.difficulty-icon.medium { background-color: #F59E0B; }
.difficulty-icon.hard { background-color: #F97316; }
.difficulty-icon.expert { background-color: #EF4444; }

.reward {
    font-size: 0.875rem;
    font-weight: bold;
    color: #34D399;
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .puzzle-piece {
        font-size: 1rem;
    }
    
    .game-mode-card, .difficulty-option {
        padding: 0.75rem;
    }
    
    .mode-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    .brain-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Enhanced Visual Feedback */
.puzzle-piece.moving {
    animation: movePiece 0.3s ease-in-out;
}

@keyframes movePiece {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Success Celebration */
@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
}

.puzzle-complete {
    animation: celebrate 0.5s ease-in-out 3;
}

/* Enhanced Progress Bar */
#puzzleProgress {
    background: linear-gradient(90deg, #FF3600, #FF8C00, #FFB800);
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Enhanced Timer Styles */
.timer {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #111827, #1f2937);
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.timer.warning {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: pulse 1s infinite;
  color: white;
}

/* Enhanced Credit System Styles */
.credit-display {
  background: linear-gradient(135deg, #FFD700, #FFA500, #FF8C00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
  font-size: 1.5rem;
}

.credit-cost {
  color: #ef4444;
  font-weight: bold;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
}

.credit-reward {
  color: #10b981;
  font-weight: bold;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
}

/* Enhanced Game Level Styles */
.level-easy {
  border-left: 4px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
}

.level-medium {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
}

.level-hard {
  border-left: 4px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
}

/* Enhanced Achievement Badge Styles */
.achievement-badge {
  position: relative;
  display: inline-block;
  transition: all 0.3s ease;
}

.achievement-badge .badge-tooltip {
  visibility: hidden;
  width: 220px;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  text-align: center;
  border-radius: 12px;
  padding: 12px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.achievement-badge:hover .badge-tooltip {
  visibility: visible;
  opacity: 1;
}

.achievement-badge .badge-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #374151 transparent transparent transparent;
}

/* Enhanced Game Grid Layouts */
.grid-3x3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 264px;
  height: 264px;
}

.grid-4x4 {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 352px;
  height: 352px;
}

.grid-5x5 {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  width: 440px;
  height: 440px;
}

/* Enhanced Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .grid-3x3 {
    width: 240px;
    height: 240px;
  }
  
  .grid-4x4 {
    width: 320px;
    height: 320px;
  }
  
  .grid-5x5 {
    width: 400px;
    height: 400px;
  }
  
  .puzzle-piece {
    font-size: 1rem;
  }
  
  .game-stats {
    padding: 1rem;
  }
  
  .tutorial-step {
    padding: 1rem;
  }
}

/* Enhanced Game Completion Effects */
.completion-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: firework 1.5s ease-out forwards;
}

@keyframes firework {
  0% {
    transform: translate(var(--x), var(--y)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x-end), var(--y-end)) scale(0);
    opacity: 0;
  }
}

/* Enhanced Game Instruction Styles */
.game-instructions {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.game-instructions:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Enhanced Credit Purchase Modal */
.credit-package {
  border: 2px solid #374151;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.credit-package:hover {
  border-color: #FF3600;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.credit-package.featured {
  border-color: #FF3600;
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  position: relative;
  overflow: hidden;
}

.credit-package.featured::before {
  content: 'FEATURED';
  position: absolute;
  top: 10px;
  right: -30px;
  background: #FF3600;
  color: white;
  padding: 5px 30px;
  transform: rotate(45deg);
  font-size: 0.75rem;
  font-weight: bold;
}

/* Enhanced Cancel Button Styles */
.cancel-button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cancel-button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(239, 68, 68, 0.3);
}

.cancel-button:active {
  transform: scale(0.95);
}

/* Enhanced Game Category Styles */
.game-category {
  background: linear-gradient(135deg, var(--category-color-start), var(--category-color-end));
  padding: 1rem;
  border-radius: 1rem;
  color: white;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-category:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.2);
}

/* Enhanced Difficulty Selector */
.difficulty-selector {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.difficulty-option {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: 2px solid #4b5563;
  background: #374151;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: white;
}

.difficulty-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.difficulty-option.active {
  border-color: #FF3600;
  background: #FF3600;
  color: white;
  transform: scale(1.05);
}

/* Enhanced Language Selector */
.language-selector {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin: 1rem 0;
  transition: all 0.3s ease;
}

.language-selector:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .game-stats,
  .achievement-popup,
  .game-instructions {
    break-inside: avoid;
  }
}

/* Enhanced Focus States for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #FF3600;
  outline-offset: 2px;
}

/* Enhanced Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000000;
    --primary-light: #333333;
    --primary-dark: #000000;
  }
  
  .memory-card-back {
    background: #000000;
  }
  
  .puzzle-piece {
    border: 2px solid #000000;
  }
}

/* Enhanced SEO Optimization */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Enhanced Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Enhanced Error States */
.error-state {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  padding: 1rem;
  color: #fecaca;
}

/* Enhanced Success States */
.success-state {
  background: linear-gradient(135deg, #064e3b, #065f46);
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  padding: 1rem;
  color: #bbf7d0;
} 