/* ===== BODY ===== */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  background-color: #f5f6fa;
  color: #333;
}

/* ===== SYLLABUS SECTION ===== */
.syllabus {
  flex: none; 
  height: 600px; /* fixed height */
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* inner scrolling handled by subjects-container */
}

/* ===== SUBJECTS CONTAINER ===== */
.subjects-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  height: 100%;
  padding-right: 5px;
}

/* Smooth scrollbar */
.subjects-container::-webkit-scrollbar {
  width: 6px;
}
.subjects-container::-webkit-scrollbar-thumb {
  background: #007bff40;
  border-radius: 3px;
}

/* ===== INDIVIDUAL SUBJECT ===== */
.subject {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  transition: all 0.3s ease;
}

/* Header for each subject */
.subject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

/* Left side of header (icon + subject name) */
.subject-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-header-left img {
  width: 35px;
  height: 35px;
}

.subject h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #2c3e50;
}

/* ===== CLASS LIST ===== */
.class-list {
  display: none; /* toggled by JS */
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
  padding-left: 30px;
  border-left: 3px solid #007bff40;
}

/* Smooth scrollbar for class list */
.class-list::-webkit-scrollbar {
  width: 6px;
}
.class-list::-webkit-scrollbar-thumb {
  background: #007bff40;
  border-radius: 3px;
}

/* Individual class item */
.class-item {
  padding: 8px 0;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
  text-align: left; /* syllabus content aligned left */
}

.class-item:hover {
  color: #007bff;
  padding-left: 8px;
}

/* ===== POPUP ===== */
.popup {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  padding: 10px;          /* safe margin on mobile */
  overflow: hidden;        /* prevent outer scroll */
}

/* Popup header (fixed inside popup-content) */
.popup-header {
  padding: 20px 25px 10px 25px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
  z-index: 5;
}

/* Popup title */
.popup-header h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

/* Popup content box */
.popup-content {
  max-width: 700px;
  width: 95%;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;     /* rounded corners */
  background: white;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  overflow: hidden;         /* ensures content stays inside rounded corners */
  position: relative;       /* ensures close button is positioned relative to popup */
}

/* Popup title */
.popup-content h2 {
  text-align: center; /* title centered */
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.syllabus-html {
  padding: 15px 25px 25px 25px;
  overflow-y: auto;
  max-height: calc(80vh - 80px); /* leave space for header */
}

.popup-content,
.popup-content .syllabus-html {
  text-align: left;        /* left-align all text inside popup */
  display: flex;
  flex-direction: column;
}

/* Scrollable syllabus content */
.popup-content .syllabus-html {
  padding: 15px 25px 25px 25px;
  overflow-y: auto; /* only inner content scrolls */
  max-height: calc(80vh - 80px); /* leave space for header */
}

/* For long lists inside syllabus */
.popup-content .syllabus-html ul {
  padding-left: 20px;
  margin: 10px 0;
}
.popup-content .syllabus-html li {
  margin-bottom: 8px;
  text-align: left;         /* ensure list items are left-aligned */
}
/* Optional: style lists inside content */
.syllabus-html ul {
  padding-left: 20px;
  margin: 10px 0;
}
.syllabus-html li {
  margin-bottom: 8px;
}
/* Close button inside popup content */
.close-btn {
  position: absolute;
  top: 10px;                /* inside padding */
  right: 10px;              /* inside padding */
  font-size: 28px;
  font-weight: bold;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #333;
  z-index: 10;
  transition: 0.2s;
}

.close-btn:hover {
  color: #007bff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .subject h5 {
      font-size: 1rem;
  }

  .subject-header-left img {
      width: 28px;
      height: 28px;
  }

  .popup-content {
      /* padding: 20px; */
      width: 95%;
        max-height: 85%;
  }

  .popup-content h2 {
      font-size: 1.3rem;
      margin-bottom: 15px;
  }
}
