/* Custom styles for BCA 8th Sem Exam Preparation Web App */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --or-primary: #ef4444;
  --or-glow: rgba(239, 68, 68, 0.25);
  --da-primary: #38bdf8;
  --da-glow: rgba(56, 189, 248, 0.25);
  --iot-primary: #10b981;
  --iot-glow: rgba(16, 185, 129, 0.25);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Outfit', sans-serif;
}

code, pre, .font-code {
  font-family: 'Fira Code', monospace;
}

/* Glassmorphism components */
.glass-panel {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-nav {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Course Theme Glow Effects */
.course-or {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 20px -2px var(--or-glow);
}

.course-da {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 20px -2px var(--da-glow);
}

.course-iot {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 20px -2px var(--iot-glow);
}

/* Formula Pop-out Cards */
.formula-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  position: relative;
  overflow: hidden;
}

.formula-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--or-primary);
}

.formula-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
}

/* KaTeX custom sizing & color override */
.katex-display {
  margin: 0.8em 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0;
}

.katex {
  font-size: 1.1em;
  color: #f1f5f9 !important;
}

/* Step-by-Step Solver Animations */
.step-card {
  transition: all 0.4s ease-in-out;
  opacity: 0;
  transform: translateY(12px);
}

.step-card.active {
  opacity: 1;
  transform: translateY(0);
}

.step-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Quiz Engine Styling */
.quiz-option {
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-option:hover:not(.disabled) {
  border-color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.1);
}

.quiz-option.correct {
  border-color: #10b981 !important;
  background-color: rgba(16, 185, 129, 0.2) !important;
  color: #a7f3d0 !important;
}

.quiz-option.incorrect {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.2) !important;
  color: #fecdd3 !important;
}

/* Speech Audio Player Bar */
.audio-bar {
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

/* Code Sandbox Highlight */
.code-wrapper {
  position: relative;
  background: #090d16;
  border-radius: 0.5rem;
  border: 1px solid #1e293b;
}

.code-wrapper pre {
  padding: 1rem;
  overflow-x: auto;
}

/* Pulsing Badge for OR Priority */
@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.priority-pulse {
  animation: pulse-red 2s infinite;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .katex {
    font-size: 0.95em;
  }
}
