/**
 * Theme Variations and Advanced Styling
 * QuizzMan Classroom - Enhanced Visual Experience
 */

/* ============ DARK MODE THEME ============ */
@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Mode Colors */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #1e3a8a;
    
    --background: #0f172a;
    --background-alt: #1e293b;
    --surface: #1e293b;
    --surface-hover: #334155;
    
    --border: #334155;
    --border-light: #475569;
    --border-dark: #64748b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --text-inverse: #0f172a;
    
    /* Dark Mode Shadows */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
    --shadow-colored: 0 10px 25px -5px rgba(96, 165, 250, 0.25), 0 4px 6px -2px rgba(96, 165, 250, 0.1);
  }

  body::before {
    background: 
      radial-gradient(circle at 25% 25%, rgba(96, 165, 250, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  }

  .welcome-section {
    background: linear-gradient(135deg, 
      #1e293b 0%, 
      #334155 40%, 
      #475569 80%, 
      #64748b 100%);
  }

  .header {
    background: rgba(30, 41, 59, 0.95);
    border-bottom: 1px solid var(--border);
  }

  .btn-primary {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-colored);
  }

  .stat-card,
  .class-card,
  .assignment-card {
    background: var(--surface);
    border-color: var(--border);
  }

  .modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
  }
}

/* ============ CUSTOM THEME VARIATIONS ============ */

/* Ocean Theme */
.theme-ocean {
  --primary-color: #0ea5e9;
  --primary-hover: #0284c7;
  --accent-color: #06b6d4;
  --accent-hover: #0891b2;
  --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
}

/* Forest Theme */
.theme-forest {
  --primary-color: #059669;
  --primary-hover: #047857;
  --accent-color: #10b981;
  --accent-hover: #059669;
  --gradient-primary: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

/* Sunset Theme */
.theme-sunset {
  --primary-color: #f59e0b;
  --primary-hover: #d97706;
  --accent-color: #f97316;
  --accent-hover: #ea580c;
  --gradient-primary: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

/* Purple Theme */
.theme-purple {
  --primary-color: #8b5cf6;
  --primary-hover: #7c3aed;
  --accent-color: #a855f7;
  --accent-hover: #9333ea;
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
}

/* ============ ADVANCED ANIMATIONS ============ */

/* Floating Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Gradient Animation */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-2px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(2px);
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In From Right */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In From Left */
@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Zoom In */
@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}

/* Rotate In */
@keyframes rotateIn {
  0% {
    opacity: 0;
    transform: rotate(-200deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0);
  }
}

/* ============ UTILITY ANIMATION CLASSES ============ */

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-shake {
  animation: shake 0.5s;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out;
}

.animate-zoom-in {
  animation: zoomIn 0.6s ease-out;
}

.animate-rotate-in {
  animation: rotateIn 0.6s ease-out;
}

/* Delayed animations */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* ============ GRADIENT BACKGROUNDS ============ */

.gradient-bg-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-bg-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-bg-5 {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-animated {
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* ============ GLASSMORPHISM EFFECTS ============ */

.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
}

.glass-dark {
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
}

.glass-card {
  @extend .glass;
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* ============ NEUMORPHISM EFFECTS ============ */

.neomorphism {
  background: var(--background);
  border-radius: var(--radius-xl);
  box-shadow: 
    8px 8px 16px rgba(0, 0, 0, 0.1),
    -8px -8px 16px rgba(255, 255, 255, 0.8);
}

.neomorphism-inset {
  background: var(--background);
  border-radius: var(--radius-xl);
  box-shadow: 
    inset 8px 8px 16px rgba(0, 0, 0, 0.1),
    inset -8px -8px 16px rgba(255, 255, 255, 0.8);
}

.neomorphism-button {
  @extend .neomorphism;
  padding: var(--space-md) var(--space-xl);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.neomorphism-button:hover {
  box-shadow: 
    4px 4px 8px rgba(0, 0, 0, 0.15),
    -4px -4px 8px rgba(255, 255, 255, 0.9);
}

.neomorphism-button:active {
  @extend .neomorphism-inset;
}

/* ============ ADVANCED HOVER EFFECTS ============ */

.hover-grow {
  transition: transform var(--transition-base);
}

.hover-grow:hover {
  transform: scale(1.05);
}

.hover-shrink {
  transition: transform var(--transition-base);
}

.hover-shrink:hover {
  transform: scale(0.95);
}

.hover-rotate {
  transition: transform var(--transition-base);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-skew {
  transition: transform var(--transition-base);
}

.hover-skew:hover {
  transform: skew(-10deg);
}

.hover-glow {
  transition: all var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.hover-shadow {
  transition: box-shadow var(--transition-base);
}

.hover-shadow:hover {
  box-shadow: var(--shadow-xl);
}

/* ============ TEXT EFFECTS ============ */

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-glow {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.text-outline {
  -webkit-text-stroke: 1px var(--primary-color);
  text-stroke: 1px var(--primary-color);
}

/* ============ LOADING STATES ============ */

.loading-dots::after {
  content: '';
  animation: loadingDots 1.5s infinite;
}

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

.loading-bar {
  position: relative;
  overflow: hidden;
  background: var(--background-alt);
  border-radius: var(--radius);
  height: 4px;
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: var(--gradient-primary);
  transform: translateX(-100%);
  animation: loadingBar 2s infinite;
}

@keyframes loadingBar {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============ RESPONSIVE HELPERS ============ */

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
  
  .mobile-stack {
    flex-direction: column !important;
  }
  
  .mobile-full-width {
    width: 100% !important;
  }
  
  .mobile-center {
    text-align: center !important;
  }
  
  .mobile-hidden {
    display: none !important;
  }
}