@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Color Palette - Premium Clean Classic / Editorial Theme */
  --bg-color: #faf9f6; /* Warm alabaster/off-white */
  --card-bg: #ffffff;
  --card-border: #e2e8f0; /* Slate 200 */
  --card-hover-bg: #f8fafc;
  --card-hover-border: #cbd5e1;

  /* Brand Accents */
  --primary: #0f172a; /* Deep Slate/Navy */
  --primary-hover: #1e293b;
  --secondary: #475569; /* Slate 600 */
  --accent: #3b82f6; /* Classic Blue */
  --success: #16a34a; /* Classic Green */
  --error: #dc2626; /* Classic Red */
  --track-color: #e2e8f0; /* Progress track color */

  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --shadow-premium: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --border-radius-lg: 12px;
  --border-radius-md: 8px;
  --border-radius-sm: 6px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 40px 20px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}
::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Premium Layout Elements */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

/* Glassmorphism Card Base - Transformed to Clean Premium Card */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-premium);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

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

/* Hide background glowing spots for classic clean design */
.glow-spot-1, .glow-spot-2 {
  display: none !important;
}

/* Typography & Titles */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.gradient-text {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  background-clip: initial !important;
  color: var(--primary) !important;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Input Fields */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-field {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Custom Select Dropdown Styling */
select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 40px;
}

/* Buttons */
.btn {
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--border-radius-sm);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 12px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.btn:disabled {
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--card-hover-border);
  box-shadow: none;
}

.btn-danger {
  background: #fff;
  border: 1px solid var(--error);
  color: var(--error);
  box-shadow: none;
}

.btn-danger:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
  box-shadow: none;
}

/* Quiz Option Selection List */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
}

.option-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.option-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  transform: none;
}

.option-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.option-card.correct-choice {
  background: #f0fdf4 !important;
  border-color: var(--success) !important;
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.15);
}

.option-card.correct-choice .option-badge {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}

.option-card.incorrect-choice {
  background: #fef2f2 !important;
  border-color: var(--error) !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.15);
}

.option-card.incorrect-choice .option-badge {
  background: var(--error) !important;
  border-color: var(--error) !important;
  color: #fff !important;
}

.option-card.locked {
  pointer-events: none;
  opacity: 0.85;
}

/* Progress bar container */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.progress-container {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 2.5px;
  margin-bottom: 30px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* Keep transitions simple and quick */
.quiz-animated-container {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

/* 1. Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.slide-up {
  animation-name: slideUp;
}

/* 2. Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.fade-in {
  animation-name: fadeIn;
}

/* 3. Zoom In Animation */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.zoom-in {
  animation-name: zoomIn;
}

/* 4. Flip Card Animation (Simplified for classic feel) */
@keyframes cardFlip {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card-flip {
  animation-name: cardFlip;
}

/* Results Scorecard circular chart */
.score-circle-container {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.score-circle {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, var(--track-color) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-circle-inner {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.score-circle-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-circle-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Review Answers layout */
.review-section {
  margin-top: 40px;
  border-top: 1px solid var(--card-border);
  padding-top: 30px;
}

.review-item {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
}

.review-question {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.review-answers-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-ans {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
}

.review-ans.correct {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
  color: #166534;
}

.review-ans.user-incorrect {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  color: #991b1b;
}

/* Admin Dashboard Elements */
.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  width: 100%;
  max-width: 1200px;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 16px;
}

.admin-q-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-md);
  padding: 18px;
  margin-bottom: 12px;
  position: relative;
}

.admin-q-card .actions {
  position: absolute;
  top: 18px;
  right: 18px;
}

.admin-q-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 8px;
  padding-right: 80px;
}

.admin-q-options {
  font-size: 0.9rem;
  color: var(--text-secondary);
  list-style: none;
  margin-left: 4px;
}

.admin-q-options li {
  margin-bottom: 4px;
  padding-left: 16px;
  position: relative;
}

.admin-q-options li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--secondary);
}

.admin-q-options li.correct {
  color: var(--success);
  font-weight: 600;
}

.admin-q-options li.correct::before {
  content: '✓';
  color: var(--success);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 500;
  margin-top: 6px;
}

.badge.animation-badge {
  background: #eff6ff;
  color: #2563eb;
}

/* Admin submissions list */
.sub-list {
  max-height: 400px;
  overflow-y: auto;
}

.sub-item {
  border-bottom: 1px solid var(--card-border);
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-item:last-child {
  border-bottom: none;
}

.sub-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.sub-info p {
  font-size: 0.75rem;
}

.sub-score {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
}

.sub-score.pass {
  color: var(--success);
}

.sub-score.fail {
  color: var(--error);
}

/* Layout Utilities */
.text-center {
  text-align: center;
}

.flex-row {
  display: flex;
  gap: 12px;
}

.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.mt-12 { margin-top: 12px; }

/* Dynamic Animation selector preview */

/* Submissions Table */
.submissions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.9rem;
}

.submissions-table th {
  text-align: left;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--card-border);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.submissions-table td {
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.submissions-table tr:hover td {
  background: var(--card-hover-bg);
}
