/* --- GLOBAL --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #f9fafc;
  color: #1e293b;
  padding: 15px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: 'Poppins';
  
}


/* --- HEADER --- */
header {
  text-align: center;
  margin-top: 10px;
}

h1 {
  font-size: 1.8em;
  color: #0f62fe;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: 0.95em;
  color: #475569;
  margin-top: 3px;
}

/* --- INTRO TEXT --- */
.intro {
  text-align: center;
  color: #475569;
  font-size: 0.95em;
  margin: 10px auto 20px;
  max-width: 320px;
}

/* --- SECTION TITLE --- */
.section-title {
  font-size: 1.1em;
  font-weight: 600;
  text-align: center;
  color: #334155;
  margin-bottom: 15px;
}

/* --- CARDS --- */
.topics {
  display: grid;
  gap: 14px;
}

.card {
  background: white;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.card:hover {
  transform: scale(1.02);
  border-color: #0f62fe;
  background-color: #f0f7ff;
}

.icon {
  background: #0f62fe10;
  color: #0f62fe;
  padding: 12px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.icon svg {
  width: 28px;
  height: 28px;
}

.card h3 {
  color: #0f172a;
  font-size: 1.05em;
  margin-bottom: 4px;
}

.card p {
  color: #64748b;
  font-size: 0.9em;
}

/* --- FOOTER --- */

footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.8em;
  color: #94a3b8;
  padding: 15px 0;
  z-index: 10;
}
/* For the top bar of each course page */
#gross h2, #neuro h2, #histology h2, #embryology h2, #histochemistry h2, #quiz h2{
  text-align: center;
  margin: 0;
  font-weight: 600;
  padding: 3rem 0rem 1rem 0;
}

.back-btn {
  position: absolute;
  top: 20px;
  left: 15px;
  font-size: 1.2em;
  cursor: pointer;
  z-index: 1000;
}

.page{
  position: absolute;
  top: 0px;
  left: 100%;
  width: 100%;
  min-height: 100vh;
  background: #f8fafc;
  padding: 40px;
  transition: all 0.4s ease;
  opacity: 0;
  overflow-y: auto;
  z-index: 2;
}

/* When active, slide into view */
.page.active {
  left: 0;
  opacity: 1;
}

/* Hide home content when subpage is active */
body.subpage main,
body.subpage header,
body.subpage .intro,
body.subpage footer {
  display: none;
}
.feedback-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2563eb;
  color: white;
  border-radius: 50%;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
  z-index: 1000;
}

.feedback-btn:hover {
  background: #1e40af;
  transform: scale(1.1);
}

/* Subtopic list styling */
.topics-list {
  display: none;
  margin-left: 25px;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.sub-card {
  background: #f1f5f9;
  margin: 5px 0;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 0.95em;
  color: #334155;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.sub-card:hover {
  transform: scale(1.02);
  border-color: #0f62fe;
  background-color: #f0f7ff;
}

/* Rotate the chevron when open */
.card.open .dropdown-icon {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}


/* === SUMMARY PAGE STYLES === */
#summaryPage {
  background: #ffffff;
  padding: 20px;
  min-height: 100vh;
  overflow-y: auto;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.summary-header h2 {
  flex: 1;
  text-align: center;
  font-size: 1.3em;
  color: #1e293b;
  margin: 0;
}

.back-btn {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: #1e293b;
}

.summary-body {
  font-size: 1em;
  line-height: 1.6;
  color: #334155;
}

.summary-footer {
  margin-top: 30px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  color: #475569;
  font-size: 0.9em;
}

/* === JOIN POPUP STYLES === */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.4s ease;
}

.popup-content {
  background: #fff;
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.popup-content h2 {
  color: #0f62fe;
  font-size: 1.3em;
  margin-bottom: 10px;
}

.popup-content p {
  font-size: 0.95em;
  color: #475569;
  margin-bottom: 15px;
}

.popup-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.popup-buttons button {
  border: none;
  border-radius: 10px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

#joinNowBtn {
  background-color: #0f62fe;
  color: white;
}

#joinNowBtn:hover {
  background-color: #1e40af;
}

#laterBtn {
  background-color: #e2e8f0;
  color: #1e293b;
}

#laterBtn:hover {
  background-color: #cbd5e1;
}

/* Simple fade & slide animations */
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.reminder-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.reminder-box {
  background: #fff;
  padding: 20px 25px;
  border-radius: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  text-align: center;
  width: 80%;
  max-width: 320px;
  animation: fadeIn 0.4s ease;
}

.reminder-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: space-around;
}

.reminder-buttons button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  font-size: 0.9em;
}

.reminder-buttons button:hover {
  background: #1d4ed8;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.table-container{
  overflow-x: auto;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 15px;
}

.summary-table th, .summary-table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
  overflow-x: auto;

}

.summary-table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* === DARK MODE GENERAL STYLES === */
body.dark-mode {
  background-color: #0f172a; /* Deep navy */
  color: #f1f5f9; /* Soft light text */
}

/* For all pages and content sections */
body.dark-mode .page,
body.dark-mode main,
body.dark-mode header,
body.dark-mode footer,
body.dark-mode #summaryPage {
  background-color: #0f172a;
  color: #f1f5f9;
}

/* Fix card, sub-card, and list styles */
body.dark-mode .card,
body.dark-mode .sub-card {
  background-color: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

body.dark-mode .card:hover,
body.dark-mode .sub-card:hover {
  background-color: #334155;
}

/* Adjust popup and buttons */
body.dark-mode .reminder-popup,
body.dark-mode .join-popup {
  background-color: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
}

/* Links, icons, etc. */
body.dark-mode a,
body.dark-mode .feedback-btn {
  color: #f1f5f9;
  background-color: #1e40af;
}

body.dark-mode .card h3{
  color:#0f62fe;
}
body.dark-mode .back-btn{
  color: #fff;
}

body.dark-mode .notes-box{
  background-color: #0f172a;
}
body.dark-mode #notesInput{
  background-color: #334155;
  color: #fff;
}


/* ==== SLIDING SWITCH ==== */
.switch {
  position: fixed;
  top: 15px;
  right: 15px;
  display: inline-block;
  width: 60px;
  height: 28px;
  z-index: 2000;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider track */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #e2e8f0;
  border-radius: 34px;
  transition: 0.4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px;
}

/* The circle */
.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

/* Sun + Moon icons */
.slider .sun,
.slider .moon {
  font-size: 15px;
  transition: opacity 0.3s ease;
}

/* When checked = dark mode */
input:checked + .slider {
  background-color: #1e293b;
}

input:checked + .slider:before {
  transform: translateX(32px);
}

/* Light mode = show sun */
input:not(:checked) + .slider .moon {
  opacity: 0.2;
}

/* Dark mode = show moon */
input:checked + .slider .sun {
  opacity: 0.2;
}

/* ===== DARK MODE FIX FOR SUMMARY PAGE ===== */
body.dark-mode #summaryPage {
  background-color: #0f172a;
  color: #e8e6e3;
}

body.dark-mode #summaryPage h2 {
  color: #e2e8f0;
}

body.dark-mode #summaryContent {
  color: #e8e6e3;
}

body.dark-mode #summaryReferences {
  color: #cbd5e1;
}

body.dark-mode #summaryReferences li {
  color: #cbd5e1;
}


/* ===== DARK MODE FIX FOR REMINDER POPUP ===== */
body.dark-mode .reminder-popup {
  background: rgba(15, 23, 42, 0.8); /* darker blur */
}

body.dark-mode .reminder-box {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
}

body.dark-mode .reminder-box button {
  background: #334155;
  color: #f1f5f9;
}

body.dark-mode .reminder-box button:hover {
  background: #475569;
}


/* ===== Flashcard / Quiz styles ===== */

.reveal{
  text-align: center;
}

.pre-quiz {
  background: #fff;
  padding: 18px;
  border-radius: 12px;
  margin: 12px 0;
  text-align: center;
  box-shadow: 0 6px 18px rgba(2,6,23,0.06);
}
.pre-quiz-controls button { margin: 8px; padding: 10px 16px; border-radius: 10px; cursor:pointer; }

/* container */
.flashcard-container {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
  margin-top: 12px;
  line-height: 1.2;   /* Adds clean spacing between lines */
  padding: 1rem;      /* More breathing room */
  text-align: center;
}


/* progress */
.progress-row { width: 100%; max-width:600px; display:flex; gap:12px; align-items:center; }
#progressText { font-size:0.95rem; color:#334155; min-width:70px; text-align:left; }
#progressBar { flex:1; height:8px; background:#e6edf9; border-radius:6px; overflow:hidden; }
#progressFill { height:100%; width:0%; background:#0f62fe; transition: width 300ms ease; }

/* card */
.flashcard {
  width: 100%;
  max-width: 650px;
  height: 320px;
  perspective: 1200px;
  cursor: pointer;
  border-radius: 5px; 

}
.card-face {
  position:absolute;
  width:100%;
  height:100%;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.08);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: 1.05rem;
  line-height: 1.6;
  color:#0f172a;
}
.front { background: #fff; transform: rotateY(0deg); }
.back { background:#f7fafc; transform: rotateY(180deg); }

/* 3D flip wrapper */
.flashcard .card-face { transition: transform 400ms ease, opacity 300ms ease; }
.flashcard.flipped .front { transform: rotateY(-180deg); opacity:0; }
.flashcard.flipped .back  { transform: rotateY(0deg); opacity:1; }

/* button row */
.flashcard-buttons {
  display:flex;
  gap:70px; 
  padding:1rem;
}
  
.flashcard-buttons button {
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  border: none;
  background: #fff;
  box-shadow: 0 6px 16px rgba(2,6,23,0.06);
}
.flashcard-buttons #rightBtn { background:#10b981; color:#fff; }
.flashcard-buttons #wrongBtn { background:#ef4444; color:#fff; }

/* score screen */
.score-screen { text-align:center; padding:18px; margin-top:12px; background:#fff; border-radius:12px; }
.score-controls button { margin:8px; padding:10px 12px; border-radius:10px; cursor:pointer; }

body.dark-mode .pre-quiz{
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
}

body.dark-mode .flashcard {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
}
body.dark-mode .score-screen {
  color: black;
}

/* ===== LOADER STYLES ===== */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background, #0a0f23);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-content {
  text-align: center;
  animation: fadeIn 1.2s ease forwards;
}

#loader img {
  width: 110px;
  height: 110px;
  margin-bottom: 20px;
 border-radius: 30px;
  animation: float 2.2s infinite ease-in-out;
}

/* Pulse animation under the logo */
.loader-pulse {
  width: 18px;
  height: 18px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse 0.9s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.6; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.7); opacity: 0.6; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide loader smoothly */
#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

 /*USER FLASHCARDS*/
 .muted{color:#6b7280;font-size:14px;margin-bottom:12px}

  .panel{background:#fff;padding:12px;border-radius:12px;box-shadow:0 8px 20px rgba(12,15,30,0.06);margin-bottom:12px}
  .topic-row{display:flex;justify-content:space-between;align-items:center;padding:12px;border-radius:10px;border:1px solid #eef2f8;margin-bottom:8px}
  .topic-left{display:flex;flex-direction:column}
  .topic-title{font-weight:700}
  .topic-sub{font-size:13px;color:#6b7280}
  .small-btn{padding:8px 10px;border-radius:10px;border:none;background:#2563eb;color:#fff;cursor:pointer;font-weight:600}

  .card-list{margin-top:8px}
  .mini-card{background:#fbfcff;padding:8px;border-radius:8px;border:1px solid #eef2f8;margin-bottom:6px;font-size:14px}
  .actions{display:flex;gap:8px}

  .floating {
    position:fixed; right:18px; bottom:18px;
    width:56px;height:56px;border-radius:50%;background:#10b981;color:#fff;font-size:28px;border:none;cursor:pointer;
    box-shadow:0 14px 30px rgba(16,185,129,0.18);
  }

  .empty{padding:18px;border-radius:10px;border:2px dashed #e6e9ef;background:transparent;color:#6b7280;text-align:center}

  a.link{color:#2563eb;text-decoration:none;font-weight:600}
  .danger{background:#ef4444}
  
  /*CREATE FLASHCARD*/
  .card{background:#fff;padding:14px;border-radius:12px;box-shadow:0 8px 20px rgba(12,15,30,0.06);}
  label{display:block;margin-top:8px;color:#374151;font-size:13px;}
  input, textarea{width:100%;padding:10px;margin-top:6px;border-radius:8px;border:1px solid #e6e9ef;box-sizing:border-box;font-size:15px}
  .row{display:flex;gap:8px;margin-top:12px}
  .btn{flex:1;padding:11px;border-radius:10px;border:none;cursor:pointer;font-weight:600;background:#2563eb;color:#fff}
  .btn.ghost{background:#eef2ff;color:#2563eb}
  .note{color:#6b7280;font-size:13px;margin-top:10px}
  a.back{display:inline-block;margin-top:12px;color:#2563eb;text-decoration:none;font-weight:600}
  
/* --- modal animation (put near your modal styles) --- */
/* hidden by default (keeps layout clean) */
.modal {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0,0,0,0.45);
  overflow-y: auto;
  transition: opacity 220ms ease;
  opacity: 0;
animation: slideUp 0.6s ease-out forwards;
}

/* content initial transform (slide up from bottom) */
.modal-content {
  background-color: #fff;
  color: #000;
  padding: 20px;
  width: 92%;
  max-width: 440px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.2);
  transform: translateY(28px) scale(0.995);
  transition: transform 280ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease;
  opacity: 0;
animation: slideUp 0.6s ease-out forwards;
}

/* visible state */
.modal.show {
  display: flex;     /* make it visible */
  opacity: 1;
}

/* modal content visible (final position) */
.modal.show .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* smooth hide using a class (prevents jump when removing show) */
.modal.hiding {
  opacity: 0;
}

/* smaller screen tweak: keep modal content comfortable */
@media (max-width: 420px) {
  .modal-content { width: 94%; padding: 18px; }
}

/* close button style (if you want) */
.modal-content .close {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 1.4rem;
  cursor: pointer;
  background: none;
  border: none;
}


@font-face {
  font-family: 'Poppins';
  src: url('./fonts/Poppins-Regular.ttf') format('truetype');
 font-weight: 400;
  font-style: normal;
 font-display: swap;
}

 @font-face {
 font-family: 'Poppins';
 src: url('./fonts/Poppins-SemiBold.ttf') format('truetype');
  font-weight: 600;
 font-style: normal;
 font-display: swap;
}
  


iframe {
  width: 100%;
  max-width: 100%;
  height: 60vh; /* Adjust based on your preference */
  border: none;
  display: block;
  margin: 1rem 0;
  border-radius: 8px; 
}



@media (min-width: 768px) {
      iframe {
    height: 70vh;
    }
}


.snow span {
  position: fixed;
  top: -10px;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: fall linear infinite;
}

.snow span:nth-child(odd) { animation-duration: 2s; }
.snow span:nth-child(even) { animation-duration: 2s; }

@keyframes fall {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(110vh);
  }
}

.notes-box {
  margin-top: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.note-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  right: 0px;
}

#noteArea {
  margin-top: 12px;
}

#notesInput {
  width: 100%;
  min-height: px;
  padding: 12px;
 border-radius: 10px;
  border: 1px solid #cbd5f5;
  font-size: 14px;
  resize: vertical;
}

.save-note-btn {
  margin-top: 10px;
  background: #16a34a;
  color: white;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

 input :focus {
  border-color: #2563eb;
  outline: none;
}

iframe .video{
  width: 100%;
  aspect-ratio: 600 / 338;
  border: none;
  display: block;
  border-radius: 8px;
}

img {
  max-width: 100%;
  height: auto;
}
