/* QuizGenie - Static Edition Complete Standalone Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Bengali:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --brand-primary: #176557;
  --brand-primary-hover: #114e43;
  --brand-primary-light: #eaf4f1;
  --brand-accent: #d2a34b;
  --brand-dark: #1e332d;
  --brand-bg: #f8fafc;
  --brand-border: #e2e8f0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--brand-bg);
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

.font-outfit {
  font-family: 'Outfit', sans-serif;
}

.font-bengali {
  font-family: 'Noto Sans Bengali', 'Inter', sans-serif;
}

/* Base element resets to prevent oversized icons or unstyled raw buttons */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
svg.w-3 { width: 0.75rem; height: 0.75rem; }
svg.w-3\.5 { width: 0.875rem; height: 0.875rem; }
svg.w-4 { width: 1rem; height: 1rem; }
svg.w-5 { width: 1.25rem; height: 1.25rem; }
svg.w-6 { width: 1.5rem; height: 1.5rem; }
svg.w-8 { width: 2rem; height: 2rem; }
svg.w-10 { width: 2.5rem; height: 2.5rem; }
svg.w-12 { width: 3rem; height: 3rem; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Core Structural Grid & Flexbox Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-1\.5 > * + * { margin-top: 0.375rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-2\.5 > * + * { margin-top: 0.625rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:hidden { display: none; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
  .sm\:text-base { font-size: 1rem; line-height: 1.5rem; }
}

@media (min-width: 1024px) {
  .lg\:grid { display: grid; }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-4 { grid-column: span 4 / span 4; }
  .lg\:col-span-8 { grid-column: span 8 / span 8; }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Sizing & Positioning */
.max-w-7xl { max-width: 80rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-xl { max-width: 36rem; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }

.sticky { position: sticky; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.top-0 { top: 0; }
.inset-0 { inset: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Padding & Margin Utilities */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-4 { padding-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-3\.5 { margin-top: 0.875rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

/* Colors & Backgrounds */
.bg-white { background-color: #ffffff; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-300 { background-color: #cbd5e1; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }

.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }

.bg-brand-50 { background-color: #ecfdf5; }
.bg-brand-100 { background-color: #d1fae5; }
.bg-brand-700 { background-color: #176557; }
.bg-brand-800 { background-color: #114e43; }
.bg-brand-900 { background-color: #0d3a32; }

.bg-rose-50 { background-color: #fff1f2; }
.bg-rose-100 { background-color: #ffe4e6; }
.bg-rose-600 { background-color: #e11d48; }

.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-amber-600 { background-color: #d97706; }

.hover\:bg-brand-800:hover { background-color: #114e43; }
.hover\:bg-emerald-100:hover { background-color: #d1fae5; }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-slate-200:hover { background-color: #e2e8f0; }

.text-white { color: #ffffff; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }
.text-slate-900 { color: #0f172a; }

.text-emerald-300 { color: #6ee7b7; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-emerald-800 { color: #065f46; }
.text-emerald-900 { color: #064e3b; }
.text-emerald-950 { color: #022c22; }

.text-brand-700 { color: #176557; }
.text-brand-800 { color: #114e43; }
.text-brand-900 { color: #0d3a32; }

.text-rose-700 { color: #be123c; }
.text-rose-800 { color: #9f1239; }
.text-rose-900 { color: #881337; }
.text-rose-950 { color: #4c0519; }

.text-amber-700 { color: #b45309; }
.text-amber-800 { color: #92400e; }
.text-amber-950 { color: #451a03; }

/* Borders & Shadows */
.border { border: 1px solid #e2e8f0; }
.border-b { border-bottom: 1px solid #e2e8f0; }
.border-t { border-top: 1px solid #e2e8f0; }
.border-dashed { border-style: dashed; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-emerald-300 { border-color: #6ee7b7; }
.border-emerald-500 { border-color: #10b981; }
.border-rose-200 { border-color: #fecdd3; }
.border-rose-300 { border-color: #fda4af; }
.border-rose-500 { border-color: #f43f5e; }
.border-amber-200 { border-color: #fde68a; }
.border-amber-300 { border-color: #fcd34d; }
.border-brand-200 { border-color: #a7f3d0; }
.border-brand-700 { border-color: #176557; }

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

.shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-sm { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }

/* Typography & Interactive Controls */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.cursor-pointer { cursor: pointer; }
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font-family: inherit;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: #176557;
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 101, 87, 0.15);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* Bloom's Taxonomy Badges */
.badge-remember {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.badge-understand {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-apply {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.badge-analyze {
  background-color: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}
.badge-evaluate {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.badge-create {
  background-color: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

/* Micro-animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulseGlow 2s infinite ease-in-out;
}

/* Glassmorphism & Cards */
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 229, 0.9);
}

.card-hover-effect {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-hover-effect:hover {
  border-color: #176557;
  box-shadow: 0 4px 14px -2px rgba(23, 101, 87, 0.08);
}

/* Print Stylesheet for Classroom & Paper Output */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm 16mm 14mm 16mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.4 !important;
  }

  /* Hide interactive UI elements */
  header,
  #setup-panel,
  #setup-wizard-container,
  #toolbar,
  #status-banner,
  #quiz-scoreboard,
  .no-print,
  button,
  .modal-overlay,
  .toast-container {
    display: none !important;
  }

  /* Make paper occupy full printable area */
  #paper-view,
  #paper-content {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
  }

  .print-page-break {
    page-break-after: always;
  }

  .question-item {
    page-break-inside: avoid;
    break-inside: avoid;
    border: none !important;
    border-bottom: 1px dashed #cccccc !important;
    padding: 10px 0 !important;
    margin-bottom: 8px !important;
    background: transparent !important;
  }

  .student-writing-area {
    display: block !important;
    min-height: 55px;
    border-bottom: 1px dotted #999999;
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .rubric-table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  .rubric-table th,
  .rubric-table td {
    border: 1px solid #444444 !important;
    padding: 4px 6px !important;
    font-size: 9pt !important;
  }

  .print-header {
    display: block !important;
    border-bottom: 2px solid #000000;
    padding-bottom: 8px;
    margin-bottom: 14px;
  }
}
