/* ==========================================================================
   ENEM 2025 OFFICIAL EXAM BOOKLET SIMULATOR STYLESHEET
   Aesthetics: Caderno 6 Cinza Print Booklet + Modern Interactive Mechanics
   ========================================================================== */

:root {
  --bg-dark: #0b0f19;
  --paper-bg: #f9fafb;
  --paper-border: #d1d5db;
  --text-primary: #111827;
  --text-muted: #4b5563;
  --enem-header-bg: #4b5563;
  --enem-header-text: #ffffff;
  --enem-yellow: #eab308;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-green: #10b981;
  --card-border: #e5e7eb;
}

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

body {
  background-color: var(--bg-dark);
  color: #f3f4f6;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  padding-top: 4.5rem;
}

/* ================= Top Sticky Progress Header ================= */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4.5rem;
  background-color: rgba(19, 27, 46, 0.95);
  backdrop-filter: blur(12px);
  border-b: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 40;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-enem {
  background: var(--enem-yellow);
  color: #000;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.nav-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

/* LocalStorage Progress Meter */
.progress-box {
  flex: 1;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.progress-label { color: #9ca3af; }
.progress-value { color: #10b981; font-weight: 700; }

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.btn-reset {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s ease;
}
.btn-reset:hover { background: rgba(239, 68, 68, 0.25); }

/* ================= Official Exam Booklet Paper ================= */
.exam-paper {
  max-width: 1100px;
  margin: 2rem auto;
  background: var(--paper-bg);
  color: var(--text-primary);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  padding: 2.5rem;
  border: 1px solid var(--paper-border);
}

/* Official ENEM Header Strip */
.enem-header {
  border-bottom: 3px double #374151;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.enem-header-top {
  background: var(--enem-header-bg);
  color: var(--enem-header-text);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.enem-title-group h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.enem-subtitle {
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  color: #d1d5db;
  margin-top: 0.2rem;
  font-style: italic;
}

.enem-year {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--enem-yellow);
}

.enem-notice {
  background: #f3f4f6;
  border-left: 4px solid var(--brand-blue);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.enem-notice i { color: var(--brand-blue); font-size: 1.1rem; }

/* 2-Column Exam Body */
.columns-container {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid #d1d5db;
}

/* Question Block */
.question-block {
  break-inside: avoid;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-b: 2px solid #111827;
  margin-bottom: 1rem;
}

.question-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.question-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.status-not-started { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.status-explored { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.status-completed { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

.question-body {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #1f2937;
}

.question-body p {
  margin-bottom: 0.85rem;
}

/* Recreated Exam Table */
.exam-table-container {
  margin: 1rem 0;
  overflow-x: auto;
}

.exam-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  text-align: left;
}

.exam-table th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
}

.exam-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
}

/* Exam Image Boxes for User Provided PNGs (136.png, 138.png, 140.png, 142.png) */
.exam-image-box {
  background: #ffffff;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.enem-img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.figure-caption {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 0.5rem;
  text-align: center;
}

/* Interactive App Launch CTA Box */
.cta-box {
  background: #eff6ff;
  border: 1.5px dashed #93c5fd;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.btn-launch {
  width: 100%;
  background: var(--brand-blue);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-launch:hover {
  background: var(--brand-blue-hover);
  transform: translateY(-1px);
}

.cta-hint {
  font-family: 'Inter', sans-serif;
  font-size: 0.73rem;
  color: #4b5563;
}

/* Fullscreen Interactive Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  flex-direction: column;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #131b2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px 12px 0 0;
}

.badge-modal {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.modal-app-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.1rem;
}

.btn-close-modal {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-close-modal:hover { background: #dc2626; }

.modal-iframe-wrapper {
  flex: 1;
  width: 100%;
  background: #000;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.modal-iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive Styles */
@media (max-width: 850px) {
  .columns-container {
    column-count: 1;
  }
  .exam-paper {
    padding: 1.25rem;
  }
}
