/* IMT-BS SmartReviz — Generator Styles (v2) */
:root {
  --primary: #003D6A;
  --secondary: #0070B8;
  --accent: #E57C23;
  --bg: #F4F6F9;
  --text: #1A1A2E;
  --muted: #6B7280;
  --success: #16A34A;
  --error: #DC2626;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,61,106,0.10);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #002B4E 0%, #003D6A 50%, #005A9A 100%);
  color: #fff;
  text-align: center;
  padding: 56px 24px 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(0,112,184,0.35) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.hero-logo {
  height: 64px;
  width: auto;
  margin-bottom: 20px;
  mix-blend-mode: screen;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.80;
  max-width: 560px;
  margin: 0 auto 24px;
}

.hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* ============================================================
   FEATURES STRIP
   ============================================================ */
.features-strip {
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
}

.features-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
}

.feature-icon {
  font-size: 20px;
}

.feature-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature-sep {
  color: #D1D5DB;
  font-size: 20px;
  line-height: 1;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ============================================================
   FORM CARD
   ============================================================ */
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ============================================================
   STEPS
   ============================================================ */
.step {
  padding: 28px 28px 20px;
}

.step-divider {
  height: 1px;
  background: #F3F4F6;
  margin: 0 28px;
}

.step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   INPUTS
   ============================================================ */
input[type="text"],
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #FAFAFA;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0,112,184,0.12);
  background: #fff;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ============================================================
   DROP ZONE
   ============================================================ */
.dropzone {
  border: 2px dashed #D1D5DB;
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
  background: #FAFAFA;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--secondary);
  background: #EFF6FF;
  color: var(--secondary);
}

.dropzone.has-file {
  border-color: var(--success);
  background: #F0FDF4;
  color: var(--success);
}

.dropzone .dz-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone .dz-text { font-size: 15px; font-weight: 600; }
.dropzone .dz-formats { font-size: 13px; margin-top: 4px; opacity: 0.65; }
.dropzone input[type="file"] { display: none; }

.text-toggle {
  text-align: center;
  margin-top: 10px;
}

.text-toggle button {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-input-area {
  display: none;
  margin-top: 12px;
}

.text-input-area textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  background: #FAFAFA;
}

.text-input-area textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0,112,184,0.12);
}

.text-input-area.active { display: block; }

/* ============================================================
   GENERATE BUTTON
   ============================================================ */
.generate-container {
  padding: 20px 28px 28px;
  border-top: 1px solid #F3F4F6;
}

.btn-generate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--accent) 0%, #D4600A 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(229,124,35,0.35);
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229,124,35,0.45);
}

.btn-generate:active { transform: translateY(0); }

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-generate-icon { font-size: 18px; }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress-panel {
  display: none;
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.progress-panel.active { display: block; }

.progress-panel h3 {
  font-size: 15px;
  color: var(--primary);
  margin-bottom: 14px;
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), #38BDF8);
  border-radius: 999px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-status { font-size: 13px; color: var(--muted); }
.progress-percent { font-size: 13px; font-weight: 700; color: var(--secondary); }

/* ============================================================
   RESULT PANEL
   ============================================================ */
.result-panel {
  display: none;
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  margin-top: 20px;
}

.result-panel.active { display: block; }

.result-check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16A34A, #22C55E);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(22,163,74,0.30);
}

.result-panel h3 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 6px;
}

.result-hint {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

.result-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-download, .btn-download-html, .btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-download {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,61,106,0.25);
}
.btn-download:hover { background: #002850; transform: translateY(-1px); }

.btn-download-html {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,112,184,0.25);
}
.btn-download-html:hover { background: #005A96; transform: translateY(-1px); }

.btn-preview {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-preview:hover { background: var(--primary); color: #fff; }

/* ============================================================
   ERROR
   ============================================================ */
.error-panel {
  display: none;
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: var(--radius);
  padding: 16px 20px;
  color: #991B1B;
  margin-top: 20px;
  font-size: 14px;
}

.error-panel.active { display: block; }
.error-panel strong { display: block; margin-bottom: 4px; }

/* ============================================================
   EDITOR PANEL
   ============================================================ */
.editor-panel {
  display: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 20px;
}

.editor-panel.active { display: block; }

.editor-header {
  padding: 24px 28px 0;
}

.editor-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0 38px;
}

/* Tabs */
.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #F3F4F6;
  margin-top: 20px;
  padding: 0 28px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover { color: var(--primary); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-count {
  background: #E5E7EB;
  color: #374151;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.tab-btn.active .tab-count {
  background: var(--primary);
  color: #fff;
}

/* Tab content */
.tab-content {
  display: none;
  padding: 24px 28px;
  max-height: 520px;
  overflow-y: auto;
}

.tab-content.active { display: block; }

/* Section labels in editor */
.editor-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 20px 0 8px;
}

.editor-section-label:first-child { margin-top: 0; }

/* Generic editable fields */
.editor-panel textarea,
.editor-panel input[type="text"],
.editor-panel select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #FAFAFA;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

.editor-panel textarea:focus,
.editor-panel input[type="text"]:focus,
.editor-panel select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0,112,184,0.10);
  background: #fff;
}

/* Row items (glossary, flashcards, quiz) */
.editor-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 12px;
}

.editor-row-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-row-fields-h {
  flex: 1;
  display: flex;
  gap: 8px;
}

.editor-row-fields-h input,
.editor-row-fields-h textarea {
  flex: 1;
}

.btn-row-delete {
  background: none;
  border: none;
  color: #D1D5DB;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.btn-row-delete:hover {
  color: var(--error);
  background: #FEF2F2;
}

.btn-add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #F0F9FF;
  border: 1.5px dashed #BAE6FD;
  border-radius: 8px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}

.btn-add-row:hover {
  background: #E0F2FE;
  border-color: var(--secondary);
}

/* Quiz specific */
.quiz-editor-item {
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.quiz-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.quiz-editor-num {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-editor-preview {
  flex: 1;
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-editor-toggle {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s;
}

.quiz-editor-item.open .quiz-editor-toggle {
  transform: rotate(180deg);
}

.quiz-editor-body {
  display: none;
  padding: 0 14px 14px;
  border-top: 1px solid #E5E7EB;
}

.quiz-editor-item.open .quiz-editor-body { display: block; }

.quiz-choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}

.quiz-choice-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-choice-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  width: 14px;
}

.quiz-correct-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #E5E7EB;
}

.quiz-correct-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.quiz-correct-row select {
  width: auto;
  min-width: 80px;
}

.quiz-delete-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Chapter blocks */
.chapter-block {
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

.chapter-block-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.chapter-block-header input { flex: 1; font-weight: 600; }

.section-block {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding-left: 12px;
  border-left: 3px solid #E5E7EB;
}

.section-block-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.section-block-fields input { font-size: 13px; font-weight: 600; }
.section-block-fields textarea { font-size: 13px; min-height: 60px; }

/* Key points */
.keypoint-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.keypoint-row input { flex: 1; }

/* Editor footer */
.editor-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid #F3F4F6;
}

.btn-validate-generate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(22,163,74,0.30);
}

.btn-validate-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22,163,74,0.40);
}

.btn-validate-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   VIDEO SECTION
   ============================================================ */
.video-section {
  background: #fff;
  padding: 56px 24px;
  border-top: 1px solid #E5E7EB;
}

.video-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.video-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.video-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,61,106,0.14);
}

/* ============================================================
   SHOWCASE / CAROUSEL
   ============================================================ */
.showcase {
  background: linear-gradient(180deg, #F4F6F9 0%, #EBF0F7 100%);
  padding: 64px 24px;
  border-top: 1px solid #E5E7EB;
}

.showcase-inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.showcase-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.showcase-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 36px;
}

.carousel {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,61,106,0.16);
  background: #000;
  cursor: grab;
}

.carousel:active { cursor: grabbing; }

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 480px;
  object-fit: cover;
  object-position: top;
}

.slide-label {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.90);
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.20);
  transition: all 0.15s;
  z-index: 10;
  line-height: 1;
}

.carousel-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn.prev { left: 14px; }
.carousel-btn.next { right: 14px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #CBD5E1;
  cursor: pointer;
  transition: all 0.2s;
}

.dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 999px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #E5E7EB;
  background: #fff;
}

.footer a { color: var(--secondary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-sep { opacity: 0.4; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .hero { padding: 40px 20px 36px; }
  .hero-logo { height: 48px; }
  .hero-title { font-size: 30px; }
  .hero-subtitle { font-size: 14px; }
  .features-sep { display: none; }
  .step { padding: 20px; }
  .step-divider { margin: 0 20px; }
  .generate-container { padding: 16px 20px 20px; }
  .result-buttons { flex-direction: column; }
  .btn-download, .btn-download-html, .btn-preview { width: 100%; justify-content: center; }
  .showcase { padding: 40px 16px; }
  .showcase-title { font-size: 20px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 18px; }
}
