/* 1. Chemistry */
/* :root {
    --color-dark: #062c60;
    --color-medium: #6181f6;
    --color-light: #91b5ea;
} */

/* 2. Mathematics */
/* :root {
    --color-dark: #604e06;
    --color-medium: #c1b139;
    --color-light: #ead591;
} */

/* 3. Physics */
/* :root {
    --color-dark: #3e2c1c;
    --color-medium: #a67c52;
    --color-light: #d2b48c;
} */

/* 4. Biology */
/* :root {
    --color-dark: #0b3d12;
    --color-medium: #81f68b;
    --color-light: #91ea9e;
} */

/* 5. Geography */
/* :root {
    --color-dark: #001f54;
    --color-medium: #4c6ef5;
    --color-light: #637dce;
} */

/* 6. History */
/* :root {
    --color-dark: #5a2e0c;
    --color-medium: #e6a97f;
    --color-light: #b86d4e;
} */

/* 7. Civics */
/* :root {
    --color-dark: #1a1a1a;
    --color-medium: #7a7a7a;
    --color-light: #4d4d4d;
} */

/* 8. Economics */
/* :root {
    --color-dark: #4a4a4a;
    --color-medium: #d3d3d3;
    --color-light: #a9a9a9;
} */

/* 9. English */
/* :root {
    --color-dark: #600606;
    --color-medium: #f68181;
    --color-light: #ea9191;
} */

/* PDF Type Tabs */
.pdf-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: #f0f4f8;
  border-radius: 50px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 8px rgba(3, 45, 97, 0.08);
}

.pdf-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: #6c757d;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pdf-tab:hover {
  background: #ffffff;
  color: #032d61;
}

.pdf-tab.active {
  background: #032d61;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(3, 45, 97, 0.25);
}

.pdf-tab i {
  font-size: 0.9rem;
}

.pdf-tab.active:hover {
  background: #032d61;
  box-shadow: 0 6px 16px rgba(3, 45, 97, 0.3);
}

/* PYQ Selector Dropdown */
.pyq-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.pyq-selector.hidden {
  display: none;
}

.pyq-selector label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

.pyq-dropdown {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.9rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.pyq-dropdown:hover {
  border-color: #94a3b8;
}

.pyq-dropdown:focus {
  outline: none;
  border-color: #032d61;
  box-shadow: 0 0 0 3px rgba(3, 45, 97, 0.1);
}

@media only screen and (max-width: 768px) {
  .pyq-selector {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .pyq-selector label {
    font-size: 0.85rem;
  }

  .pyq-dropdown {
    width: 100%;
    min-width: unset;
  }
}

/* No PDF Message */
.no-pdf-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: #6c757d;
  text-align: center;
}

.no-pdf-message i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-pdf-message p {
  font-size: 1.1rem;
  margin: 0;
}

/* Content Not Available Message */
.content-not-available {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: #6c757d;
  text-align: center;
  padding: 2rem;
}

.content-not-available.hidden {
  display: none;
}

.content-not-available i {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  color: #032d61;
  opacity: 0.4;
}

.content-not-available h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #032d61;
  margin: 0 0 0.75rem 0;
}

.content-not-available p {
  font-size: 1rem;
  margin: 0;
  color: #6c757d;
  max-width: 400px;
}

/* PDF Loading State */
.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 50vh;
  color: var(--color-medium, #4c6ef5);
  text-align: center;
}

.pdf-loading i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.pdf-loading p {
  font-size: 1rem;
  margin: 0;
  color: #6c757d;
}

/* Mobile responsive for tabs */
@media only screen and (max-width: 768px) {
  .pdf-tabs {
    gap: 0.3rem;
    padding: 0.4rem;
  }

  .pdf-tab {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }

  .pdf-tab span {
    display: none;
  }

  .pdf-tab i {
    font-size: 1.1rem;
  }
}

/* PDF Zoom Toolbar */
.pdf-viewer-wrapper {
  position: relative;
  width: calc(100% - 8vw);
  height: calc(100vh - 60px);
  margin-left: 6vw;
  margin-right: 6vw;
}

.pdf-zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    rgba(30, 30, 30, 0.95),
    rgba(50, 50, 50, 0.9)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: fit-content;
  height: fit-content;
  max-width: 90%;
}

.zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.zoom-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.25);
}

.zoom-level {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
  padding: 0 0.5rem;
  user-select: none;
}

.zoom-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 0.3rem;
}

.pdf-viewer-container {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* Show horizontal scrollbar only when content overflows (zoomed in) */
.pdf-viewer-container.zoomed {
  overflow-x: auto;
}

.pdf-viewer-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.pdf-viewer-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.pdf-viewer-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.pdf-viewer-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

#pdf-viewer {
  display: inline-block;
  width: 100%;
  transform-origin: top left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  border-radius: 12px;
}

/* Each page is wrapped in .pdf-page for clear division */
.pdf-page {
  display: block;
  max-width: 100%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.pdf-page:last-child {
  margin-bottom: 0;
}

#pdf-viewer canvas {
  display: block;
  border-radius: 0;
  margin: 0;
  transform-origin: top left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width, height;
}

/* Mobile responsive adjustments */
@media only screen and (max-width: 768px) {
  .pdf-zoom-toolbar {
    padding: 0.5rem 1rem;
    gap: 0.4rem;
  }

  .zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .zoom-level {
    font-size: 0.8rem;
    min-width: 45px;
  }
}

.main-section {
  width: 70%;
  padding: 0 1rem;
}

@media only screen and (max-width: 1024px) {
  .main-section {
    width: 100%;
  }
  .pdf-viewer-wrapper {
    height: 85vh;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .pdf-viewer-container {
    height: 100%;
    width: 100%;
  }

  .section-3 {
    width: 100%;
    margin-right: 0;
    height: fit-content;
  }

  .playlist {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
  }

  /* To open the playlist, you can add another class like .open */
  .playlist.open {
    display: block;
  }

  .video-container {
    width: 0 !important;
  }

  body {
    background-color: whitesmoke;
  }

  .playlist-body {
    height: 100vh !important;
  }

  .playlist-header {
    background-color: whitesmoke !important;
  }

  .video {
    margin: 14px 0px !important;
  }
  .playlist {
    transition: transform 0.3s ease-in-out;
  }
  .closed {
    transform: translateY(100%);
  }
  .playlist-body .thumbnail {
    width: 150px;
  }
}
.subject {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

#video-number {
  color: #d9d9d9;
}

.playlist {
  border: 1px solid white;
  border-radius: 15px;
  overflow: hidden;
}

.playlist-header {
  background-color: var(--color-dark);
  padding: 1rem;
  color: white;
  /* margin-bottom: 5px; */
}

.playlist-header .chapter {
  font-size: 1.1rem;
}

.playlist-header .subject span {
  color: grey;
}

.playlist-body {
  height: 50vh; /* Fixed height */
  overflow-y: auto; /* Enable vertical scrolling */
  padding-bottom: 1rem;
}

.playlist-body .video {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.thumbnail {
  border-radius: 5px;
  overflow: hidden;
  /* box-shadow: 0 3.56158px 0 black; */
}

.playlist-body {
  background-color: whitesmoke;
  color: var(--color-dark);
}

.playlist-body .active {
  background-color: var(--color-light);
  color: white;
}

.playlist-body .video:hover {
  background-color: #f0f0f0;
}

.playlist-body .active:hover {
  background-color: var(--color-light);
}

.playlist-body .video .numbering {
  min-width: 20px;
}

.playlist-body .video:first-child {
  margin-top: 0;
}

.playlist-body .video:last-child {
  margin-bottom: 0;
}

.playlist-body .thumbnail {
  height: auto;
  width: 100px;
  aspect-ratio: 16/9;
}

.playlist-body .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-body .video-title {
  flex-grow: 1;
}

.video-3 {
  background-color: aquamarine;
}
