/* Apple-inspired Design System with Vibrant Enhancements */
:root {
  --primary-gradient: linear-gradient(135deg, #7B68EE 0%, #3498DB 100%);
  --success-gradient: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  --danger-gradient: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  --warning-gradient: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --border-radius-sm: 12px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --glow-primary: 0 0 15px rgba(123, 104, 238, 0.6);
  --glow-success: 0 0 15px rgba(46, 204, 113, 0.6);
  --glow-danger: 0 0 15px rgba(231, 76, 60, 0.6);
  --glow-warning: 0 0 15px rgba(243, 156, 18, 0.6);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 
		 'Segoe UI', Roboto, sans-serif;
  background: #000000;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  font-weight: 400;
}

/* Background Animation */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(-45deg, #0a0a12, #121225, #0d1b33, #2a1a4a);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: -2;
}

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: float 15s infinite ease-in-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

/* Header Styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-lg);
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 700;
  font-size: 1.5rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 8px;
  color: white;
  box-shadow: var(--glow-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.logo-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 10px rgba(123, 104, 238, 0.5);
}

.header-buttons {
  display: flex;
  gap: var(--spacing-sm);
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1.2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  box-shadow: var(--glass-shadow);
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.copy-btn:hover {
  background: linear-gradient(135deg, rgba(103, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
  box-shadow: var(--glow-primary);
}

.clear-btn:hover {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.3) 0%, rgba(238, 90, 36, 0.3) 100%);
  box-shadow: var(--glow-danger);
}

/* Main Content */
main {
  margin-top: 80px;
  padding: var(--spacing-lg);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-xl) 0;
}

.title {
  margin-bottom: var(--spacing-sm);
}

.gradient-text {
  background: linear-gradient(135deg, #7B68EE 0%, #3498DB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 3.5rem;
  font-weight: 800;
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  text-shadow: 0 0 15px rgba(123, 104, 238, 0.5);
  animation: textGlow 3s infinite alternate;
}

@keyframes textGlow {
  0% { text-shadow: 0 0 10px rgba(123, 104, 238, 0.5); }
  100% { text-shadow: 0 0 20px rgba(123, 104, 238, 0.8), 0 0 30px rgba(123, 104, 238, 0.6); }
}

.subtitle {
  font-size: 1.5rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: var(--spacing-sm);
}

.description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: var(--transition);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::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: 0.5s;
}

.stat-card:hover::before {
  left: 100%;
}

.stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.stat-card.highlight {
  background: linear-gradient(135deg, rgba(123, 104, 238, 0.2) 0%, rgba(52, 152, 219, 0.2) 100%);
  border: 1px solid rgba(123, 104, 238, 0.4);
  box-shadow: var(--glow-primary);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--primary-gradient);
  border-radius: 14px;
  color: white;
  font-size: 1.2rem;
  box-shadow: var(--glow-primary);
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
  text-shadow: 0 0 10px rgba(123, 104, 238, 0.3);
}

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

/* Chart Section */
.chart-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}

.chart-section:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.section-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: var(--spacing-md);
}

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

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.level1-dot {
  background: #4facfe;
  box-shadow: 0 0 8px #4facfe;
}

.level2-dot {
  background: #ff6b6b;
  box-shadow: 0 0 8px #ff6b6b;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* Question Section */
.question-section {
  margin-top: var(--spacing-xl);
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--glass-shadow);
}

.question-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--glass-shadow);
  animation: fadeInUp 0.6s ease;
  transition: var(--transition);
}

.question-card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

.question-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.question-header i {
  font-size: 1.5rem;
  color: #7B68EE;
  text-shadow: 0 0 10px rgba(123, 104, 238, 0.5);
}

#question-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}

.question-actions {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-width: 140px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

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

.action-btn:hover::before {
  left: 100%;
}

.action-btn.correct {
  background: var(--success-gradient);
  color: white;
  box-shadow: var(--glass-shadow);
}

.action-btn.correct:hover {
  box-shadow: var(--glow-success);
  transform: translateY(-3px);
}

.action-btn.wrong {
  background: var(--danger-gradient);
  color: white;
  box-shadow: var(--glass-shadow);
}

.action-btn.wrong:hover {
  box-shadow: var(--glow-danger);
  transform: translateY(-3px);
}

.action-btn.subject {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--glass-shadow);
}

.action-btn.subject:hover {
  box-shadow: var(--glow-primary);
  transform: translateY(-3px);
}

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

/* Footer Styles */
.footer {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-md) 0;
  margin-top: var(--spacing-xl);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.footer-name {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: var(--spacing-md);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 30px;
}

.footer-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 600;
}

.close {
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: var(--spacing-md);
  overflow-y: auto;
  max-height: 60vh;
}

#subject-content {
  line-height: 1.7;
  font-size: 1.05rem;
}

#subject-content pre {
  background: rgba(0, 0, 0, 0.2);
  padding: var(--spacing-md);
  border-radius: var(--border-radius-sm);
  overflow-x: auto;
  margin: var(--spacing-sm) 0;
  font-family: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9rem;
}

/* Notification */
.notification-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  color: white;
  font-weight: 500;
  box-shadow: var(--glass-shadow);
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
}

.notification.success {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.2) 0%, rgba(39, 174, 96, 0.2) 100%);
  border: 1px solid rgba(46, 204, 113, 0.3);
  box-shadow: var(--glow-success);
}

.notification.error {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.2) 100%);
  border: 1px solid rgba(231, 76, 60, 0.3);
  box-shadow: var(--glow-danger);
}

.notification.info {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(41, 128, 185, 0.2) 100%);
  border: 1px solid rgba(52, 152, 219, 0.3);
  box-shadow: var(--glow-primary);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes modalSlideIn {
  from {
  opacity: 0;
  transform: translate(-50%, -48%);
  }
  to {
  opacity: 1;
  transform: translate(-50%, -50%);
  }
}

@keyframes slideInRight {
  from {
  transform: translateX(100%);
  opacity: 0;
  }
  to {
  transform: translateX(0);
  opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard {
  grid-template-columns: 1fr;
  }
  
  .gradient-text {
  font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  .header-buttons {
  display: none;
  }
  
  .gradient-text {
  font-size: 2.2rem;
  }
  
  .subtitle {
  font-size: 1.2rem;
  }
  
  .stats-grid {
  grid-template-columns: 1fr;
  }
  
  .question-actions {
  flex-direction: column;
  align-items: center;
  }
  
  .action-btn {
  width: 100%;
  max-width: 300px;
  }
  
  .modal-content {
  width: 95%;
  margin: 10% auto;
  }
  
  .footer-content {
  flex-direction: column;
  text-align: center;
  }
  
  .footer-links {
  justify-content: center;
  }
}

@media (max-width: 480px) {
  main {
  padding: var(--spacing-sm);
  }
  
  .hero-section {
  padding: var(--spacing-lg) 0;
  }
  
  .gradient-text {
  font-size: 2rem;
  }
  
  .stat-card {
  flex-direction: column;
  text-align: center;
  }
  
  .section-header {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-sm);
  }
  
  .footer-links {
  flex-direction: column;
  gap: var(--spacing-sm);
  }
}