/* read.css */

/* ===== Base ===== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-image: url('../../assets/bk1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f7f8fb;
  user-select: none;
  -webkit-user-select: none;
}

/* Utility */
.hidden { display: none !important; }

/* Highlighted hint inside reading content */
.hint { background-color: yellow; font-weight: bold; padding: 0 4px; }

/* ===== Layout: Reading + Questions ===== */
.read-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 40px 32px;
  max-width: 1200px;
  margin: auto;
}

.reading-box {
  background: rgba(247, 248, 251, 0.2);
  padding: 24px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  line-height: 1.7;
  flex: 1;
  font-size: 18px;
}

.reading-box h2 { margin-top: 0; font-size: 24px; }

.reading-box #reading-content {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 6px;
  background: #fafafa;
}

/* Images inside reading box */
.reading-box img {
  max-width: 100%;
  margin-top: 10px;
  border-radius: 10px;
}

/* Inline header inside reading box */
.reading-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.reading-title { font-size: 22px; margin: 0; }

.question-panel {
  background: rgba(247, 248, 251, 0.2);
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  min-height: 280px;
  flex: 0 0 38%;
  max-width: 38%;
  font-size: 16px;
}

#timer {
  font-weight: bold;
  color: #d9534f;
  margin-bottom: 12px;
  font-size: 16px;
}

.question-panel h4 { margin-top: 0; font-size: 20px; }

/* Options */
.question-panel label {
  display: block;
  margin: 12px 0;
  cursor: pointer;
}

/* Buttons */
.btn {
  margin-top: 14px;
  padding: 10px 22px;
  background-color: #1976d2;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn:hover { background-color: #1259a3; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ===== Progress Circles ===== */
.progress-circles { display:flex; gap:6px; margin-bottom:10px; }
.circle { width:16px; height:16px; border-radius:50%; background:#ccc; }
.circle.correct { background:#28a745; }
.circle.wrong   { background:#dc3545; }

/* ===== Guest Banner (trial limits) ===== */
.guest-banner {
  background: rgba(25,118,210,.08);
  border: 1px solid rgba(25,118,210,.25);
  color: #0b5ed7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.guest-banner .meta { display: flex; gap: 12px; }
.guest-banner .upgrade {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #0d6efd;
  color: #fff;
  background: #0d6efd;
  text-decoration: none;
  font-weight: 600;
}
.guest-banner .upgrade:hover { background:#0b5ed7; }

/* ===== Site Header (top) ===== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1001;
  font-family: 'Inter', sans-serif;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
}

.branding { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; object-fit: contain; }
.site-name { font-size: 1.2rem; font-weight: bold; color: #333; }

.header-links { display: flex; gap: 20px; }
.header-links a { text-decoration: none; color: #1f6feb; font-weight: 500; }
.header-links a:hover { color: #0d3e90; }
.btn-login { padding: 6px 12px; border: 1px solid #ccc; border-radius: 6px; font-weight: 500; background: #fff; }

/* ===== Mobile Dropdown Sidebar ===== */
.sidebar {
  display: none;
  position: fixed;
  top: 60px; /* match header height */
  left: 0;
  right: 0;
  background-color: #fef6f0;
  padding: 16px;
  z-index: 998;
}
.sidebar.active { display: block; }

.nav-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.nav-links a { text-decoration: none; color: #1f6feb; font-weight: 500; }
.nav-links a:hover { color: #0d3e90; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 1002;
}
.hamburger span { width: 25px; height: 3px; background: #333; border-radius: 2px; }

/* ===== Footer ===== */
footer {
  color: #2b2b2b;
  padding: 32px 0 16px;
  font-family: 'Inter', sans-serif;
  width: 100%;
  flex-shrink: 0;
  width: 100%;
  text-align: center;
  display: block;
}
footer .footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0 24px;
  border-top: 2px solid #1f1f1f;
}
footer .footer-links,
footer .footer-social {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}
footer a { color: #1976d2; text-decoration: none; transition: color 0.3s ease; }
footer a:hover { text-decoration: underline; color: #1259a3; }
footer .footer-bottom { text-align: center; padding-top: 20px; color: #555; font-size: 14px; width: 100%; }

/* ===== Option + Feedback (answer review) ===== */
.option {
  display:block;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:8px;
  margin-bottom:8px;
}
.option.correct { border-color:#28a745; background:rgba(40,167,69,.08); }
.option.wrong   { border-color:#dc3545; background:rgba(220,53,69,.08); }
.option .tag { font-size:12px; margin-left:6px; opacity:.9; vertical-align: middle; }

.feedback {
  padding:12px;
  border-radius:10px;
  margin:10px 0;
}
.feedback.ok   { background:rgba(40,167,69,.08); border:1px solid rgba(40,167,69,.25); color:#1e7e34; }
.feedback.nope { background:rgba(220,53,69,.08); border:1px solid rgba(220,53,69,.25); color:#b21f2d; }

/* =========================================================
   Responsive: Header nav + Reading/Question stack behavior
   ========================================================= */

/* Hide header links, show hamburger on small screens */
@media (max-width: 768px) {
  .header-links { display: none; }
  .hamburger { display: flex; }
  .sidebar.active { display: block; }
}

/* Ensure dropdown sidebar hidden on desktop */
@media (min-width: 769px) {
  .sidebar { display: none !important; }
}

/* Stack reading above questions on tablets/phones. */
@media (max-width: 1024px) {
  .read-layout {
    display: block !important;
    padding: 20px 16px;
  }

  .reading-box,
  .question-panel {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    flex: none !important;
  }

  .reading-box { margin-bottom: 20px; }
}

/* Hidden by default in learner view */
.article .answer{
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  padding: 0 !important;
}

/* When revealed (per question or all) */
.article .answer.reveal{
  background: #d1e7dd !important;
  border: 1px dashed #0f5132 !important;
  color: inherit !important;
  padding: 2px 4px !important;
  border-radius: 4px;
}

/* Optional: a global reveal-all mode */
.article.reveal-all .answer{
  background: #d1e7dd !important;
  border: 1px dashed #0f5132 !important;
  padding: 2px 4px !important;
  border-radius: 4px;
}

/* Finished / empty state card in question panel */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.empty-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  border: 1px solid #e5e7eb;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.empty-text {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 16px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary-tab {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  cursor: pointer;
}

.btn-primary-tab:hover {
  background: #1d4ed8;
}

.btn-outline-tab {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: #374151;
  background: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-outline-tab:hover {
  background: #f9fafb;
}

/* True/False list styling for question panel */
.tf-card {
  margin-top: 16px;
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.tf-card h5 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.tf-subtitle {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #6b7280;
}

.tf-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.tf-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f9fafb;
}

.tf-number {
  font-weight: 600;
  color: #6b7280;
}

.tf-statement {
  font-size: 0.9rem;
  color: #111827;
}

.tf-explanation {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 2px;
}
