/* ==========================================================================
   Sociology Exam Q&A - Pure Academic Reader
   Clean, focused, collapsible question & answer layout
   ========================================================================== */

:root {
  --font-heading: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-text: 'Noto Serif Bengali', 'Hind Siliguri', Georgia, serif;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #f8fafc;

  --border-color: #cbd5e1;
  --border-active: #2563eb;

  --text-main: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --accent: #1d4ed8;

  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-heading);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  padding: 1.5rem 1rem 4rem;
  -webkit-font-smoothing: antialiased;
}

.page-container {
  max-width: 960px;
  margin: 0 auto;
}

/* Subject Headings */
.subject-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 3rem 0 1.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 3px solid #1e3a8a;
  line-height: 1.35;
}

.subject-title:first-of-type {
  margin-top: 1rem;
}

/* Questions List */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Collapsible Card */
details.q-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

details.q-card:hover {
  border-color: #94a3b8;
}

details.q-card[open] {
  border-color: var(--border-active);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

/* Question Header */
summary.q-header {
  padding: 1.15rem 1.35rem;
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
  background: var(--bg-card);
  line-height: 1.45;
  transition: background-color 0.15s ease;
}

summary.q-header::-webkit-details-marker {
  display: none;
}

summary.q-header:hover {
  background-color: var(--bg-hover);
}

.q-title-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
}

.star-badge {
  font-size: 0.92rem;
  letter-spacing: 2px;
  color: #b45309; /* warm amber */
  font-weight: bold;
  user-select: none;
}

details.q-card.priority-5star {
  border-left: 4px solid #d97706;
}

.q-title {
  flex: 1;
}

.arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
  margin-left: 1rem;
  flex-shrink: 0;
}

details[open] summary .arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

/* Answer Body */
.q-body {
  padding: 1.25rem 1.6rem 2rem;
  border-top: 1px solid #e2e8f0;
  font-family: var(--font-text);
  font-size: 17.5px;
  line-height: 1.95;
  color: var(--text-body);
  background: var(--bg-card);
}

.answer-content p {
  margin-bottom: 1.25rem;
  text-align: justify;
  text-indent: 1.5rem;
}

.answer-content p:first-of-type {
  text-indent: 0;
}

.answer-content h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.85rem 0 0.8rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.answer-content h5 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 1.4rem 0 0.5rem;
}

.answer-content ul, 
.answer-content ol {
  margin: 0.85rem 0 1.35rem 2.2rem;
}

.answer-content li {
  margin-bottom: 0.55rem;
  padding-left: 0.35rem;
}

.answer-content strong {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

.quote-box {
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent);
  padding: 0.95rem 1.2rem;
  margin: 1.4rem 0;
  font-style: italic;
  color: var(--text-main);
  border-radius: 0 4px 4px 0;
}

.quote-box cite {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  font-style: normal;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.4rem 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-heading);
  font-size: 0.92rem;
}

.comparison-table th, 
.comparison-table td {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.comparison-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-main);
}

.comparison-table tr:nth-child(even) td {
  background: var(--bg-subtle);
}

/* Responsive adjustment for Mobile */
@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem 3rem;
  }

  .subject-title {
    font-size: 1.3rem;
    margin: 2rem 0 1rem;
  }

  summary.q-header {
    padding: 0.95rem 1.05rem;
    font-size: 1.05rem;
  }

  .q-body {
    padding: 1rem 1rem 1.5rem;
    font-size: 16px;
    line-height: 1.85;
  }

  .answer-content p {
    text-indent: 0;
  }
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    font-size: 11.5pt;
  }

  details.q-card {
    border: none !important;
    margin-bottom: 2rem;
    page-break-after: always;
  }

  summary.q-header {
    padding: 0 0 0.5rem 0 !important;
    border-bottom: 2px solid #000 !important;
    margin-bottom: 1rem !important;
  }

  .arrow {
    display: none !important;
  }

  .q-body {
    display: block !important;
    padding: 0 !important;
    border: none !important;
  }
}

/* Modal Overlay & Popup Card - Responsive & Animated */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  visibility: visible;
}

.modal-overlay.modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-card {
  background: #ffffff;
  border-radius: 14px;
  max-width: 480px;
  width: min(94vw, 480px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid #cbd5e1;
  animation: modalScaleUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 1.15rem 1.4rem;
  background: #1e3a8a;
  color: #ffffff;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.3px;
}

.modal-body {
  padding: 1.35rem 1.4rem;
  font-family: var(--font-heading);
  color: #334155;
  line-height: 1.65;
}

.modal-highlight-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.95rem;
}

.modal-highlight {
  font-size: 1.02rem;
  color: #14532d;
  margin: 0;
}

.modal-highlight strong {
  color: #15803d;
  font-weight: 800;
}

.modal-desc {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 1.15rem;
  line-height: 1.55;
}

.modal-desc strong {
  color: #1e3a8a;
}
.modal-credit {
  background: #f8fafc;
  border-left: 3.5px solid #2563eb;
  padding: 0.65rem 0.85rem;
  font-size: clamp(0.72rem, 2.9vw, 0.92rem);
  color: #475569;
  border-radius: 0 6px 6px 0;
  margin-top: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  width: 100%;
}

.master-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 1.06em;
  color: #000000;
  display: inline-block;
  letter-spacing: 0.3px;
  background-image: linear-gradient(
    110deg,
    #000000 0%,
    #000000 38%,
    #eab308 47%,
    #fef08a 50%,
    #facc15 53%,
    #000000 62%,
    #000000 100%
  );
  background-size: 260% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: yellowFlashSweep 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes yellowFlashSweep {
  0% {
    background-position: 100% 0;
  }
  20% {
    background-position: 0% 0;
  }
  20.01% {
    background-position: 100% 0;
  }
  100% {
    background-position: 100% 0;
  }
}


.modal-footer {
  padding: 0.9rem 1.4rem 1.35rem;
  display: flex;
  justify-content: flex-end;
  background: #ffffff;
}

.modal-btn {
  background: #1e3a8a;
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.8rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.25);
}

.modal-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.35);
}

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

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
  .modal-card {
    width: 95vw;
    border-radius: 12px;
  }
  .modal-header {
    padding: 1rem 1.15rem;
  }
  .modal-header h3 {
    font-size: 1.15rem;
  }
  .modal-body {
    padding: 1.1rem;
  }
  .modal-credit {
    font-size: clamp(0.66rem, 2.7vw, 0.82rem);
    padding: 0.55rem 0.7rem;
    white-space: nowrap;
  }
  .master-name {
    font-size: 1.05em;
  }
  .modal-footer {
    padding: 0.8rem 1.1rem 1.15rem;
  }
  .modal-btn {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
  }
  .survey-opt-btn {
    padding: 0.65rem 0.5rem;
    font-size: 0.92rem;
  }
  .survey-question {
    font-size: 0.96rem;
  }
}

/* Second Interactive Survey Modal */
.survey-card {
  max-width: 440px;
}

.survey-header {
  background: linear-gradient(135deg, #9f1239 0%, #e11d48 100%);
}

.survey-question-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-left: 4px solid #e11d48;
  border-radius: 8px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.2rem;
  text-align: center;
}

.survey-question {
  font-size: 1.05rem;
  color: #881337;
  margin: 0;
  line-height: 1.6;
}

.survey-question strong {
  color: #be123c;
}

.survey-options {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.survey-opt-btn {
  flex: 1;
  max-width: 175px;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  user-select: none;
}

.survey-opt-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateY(-1px);
}

.survey-opt-btn.is-selected {
  border-color: #e11d48;
  background: #ffe4e6;
  color: #9f1239;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.22);
  transform: scale(1.03);
}

.survey-opt-btn.btn-shaking {
  animation: optShake 0.4s ease;
}

@keyframes optShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.survey-feedback {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  color: #166534;
  margin-bottom: 0.6rem;
  line-height: 1.5;
  text-align: center;
  animation: surveyFadeIn 0.3s ease;
}

@keyframes surveyFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.survey-ok-btn {
  min-width: 180px;
  text-align: center;
  transition: all 0.25s ease;
}

.survey-ok-btn:disabled {
  background: #e2e8f0 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  opacity: 0.85;
  box-shadow: none !important;
  pointer-events: none;
}

.survey-ok-btn:not(:disabled) {
  background: #e11d48;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  animation: btnUnlockPop 0.35s ease;
}

.survey-ok-btn:not(:disabled):hover {
  background: #be123c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.42);
}

@keyframes btnUnlockPop {
  0% { transform: scale(0.92); opacity: 0.7; }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
