/* ══ RESET & ROOT ══════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

:root {
  --red: #C0392B;
  --red2: #E74C3C;
  --dark: #1a1a1a;
  --mid: #444;
  --light: #f5f0e8;
  --paper: #faf7f2;
  --gold: #b8860b;
  --white: #fff;
  --shadow: 0 2px 12px rgba(0, 0, 0, .15);
  --hh: 104px;
  /* header height */
}

html {
  scroll-behavior: smooth
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--dark);
  overflow-x: hidden
}

/* ══ HEADER ════════════════════════════════════════════════════ */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow);
}

.header-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  height: 60px;
  border-bottom: 2px solid var(--red);
}

.logo-wrap {
  width: 60%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px
}

.logo-wrap img {
  height: 90%;
  width: 90%;
  /* object-fit: contain */
}

.logo-text {
  width: 60%;
}

.logo-text span {
  display: block;
  font-family: 'Noto Sans Kannada', sans-serif;
  font-size: .6rem;
  font-weight: 600;
  color: var(--mid);
  letter-spacing: .5px
}

.header-right {
  width: 40%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px
}

/* Calendar Icon */
.cal-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid var(--red);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  min-width: 38px;
}

.cal-month {
  background: var(--red);
  color: var(--white);
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 6px;
  width: 100%;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .5px
}

.cal-day {
  background: var(--white);
  color: var(--dark);
  font-size: .9rem;
  font-weight: 700;
  padding: 1px 6px;
  width: 100%;
  text-align: center
}

/* Burger */
.burger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.burger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: .3s
}

.burger-btn.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg)
}

.burger-btn.open span:nth-child(2) {
  opacity: 0
}

.burger-btn.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg)
}

/* Burger Menu Dropdown */
.burger-menu {
  display: none;
  position: fixed;
  top: 60px;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  min-width: 180px;
  border-left: 3px solid var(--red);
  z-index: 1100;
}

.burger-menu.open {
  display: block
}

.burger-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--dark);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  border-bottom: 1px solid #eee;
  transition: background .2s;
}

.burger-menu a:hover {
  background: #fff0ee;
  color: var(--red)
}

.burger-menu a i {
  width: 18px;
  color: var(--red)
}

/* Header row 2 - Page indicator */
.header-row2 {
  position: fixed;
  top: 4vh;
  left: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  /* background: #f8f8f8; */
  border-top: 1px solid #eee;
}

.page-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--mid);
  /* background-color: red; */
}

.page-dots {
  display: flex;
  gap: 4px
}

.page-dot {
  width: 18px;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  transition: .3s;
  cursor: pointer;
}

.page-dot.active {
  background: var(--red);
  width: 26px
}

.page-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--mid);
  color: blue;
  font-weight: bolder;
}

/* ══ LARGE SCREEN HEADER ═══════════════════════════════════════ */
@media(min-width:768px) {
  :root {
    --hh: 72px
  }

  .header-row1 {
    height: 72px;
    padding: 8px 24px
  }

  .header-row2 {
    display: none
  }

  .logo-wrap {
    width: auto
  }

  .header-right {
    width: auto;
    gap: 14px
  }

  .burger-btn {
    display: none
  }

  .burger-menu {
    display: none !important
  }

  .desktop-nav {
    display: flex !important
  }

  .cal-icon-desktop {
    display: flex !important
  }

  .page-indicator-desktop {
    display: flex !important;
  }
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 8px;
}

.desktop-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--red);
  border-radius: 20px;
  color: var(--red);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 600;
  transition: .2s;
  white-space: nowrap;
}

.desktop-nav a:hover {
  background: var(--red);
  color: var(--white)
}

.desktop-nav a.live {
  background: var(--red);
  color: var(--white)
}

.desktop-nav a.live:hover {
  background: var(--red2)
}

.page-indicator-desktop {
  display: none;
  align-items: center;
  gap: 4px;
  background: #f8f8f8;
  border-radius: 20px;
  padding: 4px 12px;
}

/* ══ CALENDAR MODAL ═════════════════════════════════════════════ */
#cal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 2000;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 68px;
  padding-right: 8px;
}

#cal-overlay.open {
  display: flex
}

#cal-modal {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  overflow: hidden;
  max-width: 340px;
  width: 100%;
}

.cal-modal-header {
  background: var(--red);
  color: var(--white);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-modal-header h3 {
  font-size: .95rem;
  font-weight: 700
}

.cal-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer
}

.cal-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  height: auto;
}

.cal-grid .day-head {
  font-size: .65rem;
  font-weight: 700;
  color: var(--mid);
  padding: 2px
}

.cal-cell {
  padding: 6px 2px;
  font-size: .8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  font-weight: 500;
}

.cal-cell:hover {
  background: #fee
}

.cal-cell.today {
  background: var(--red);
  color: var(--white)
}

.cal-cell.selected {
  background: var(--dark);
  color: var(--white)
}

.cal-cell.other-month {
  color: #bbb
}

.cal-cell.disabled {
  color: #ddd;
  cursor: default
}

.cal-cell[style*="not-allowed"] {
  position: relative;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Optional: add a small 'x' or dot to show it's empty */
.cal-cell[style*="not-allowed"]::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: #cf1322;
  border-radius: 50%;
}

.cal-month-label {
  padding: 4px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 700;
  color: var(--mid);
}

.cal-month-sep {
  grid-column: 1/-1;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--red);
  padding: 6px;
  background: #fff5f5;
  border-radius: 4px;
  margin: 2px 0;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ══ MARQUEE ════════════════════════════════════════════════════ */
#marquee-bar {
  position: fixed;
  top: 6vh;
  z-index: 1000;
  /* background: var(--red); */
  background-color: #0000009d;
  color: var(--white);
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 32px;
  width: 100%;
}

@media (min-width:768px) {
  #marquee-bar {
    top: 10vh;
  }
}

.marquee-content {
  white-space: nowrap;
  animation: scrollLeft 20s linear infinite;
  font-family: 'Noto Sans Kannada', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  padding-right: 60px;
}

@keyframes scrollLeft {
  from {
    transform: translateX(100vw)
  }

  to {
    transform: translateX(-100%)
  }
}

.floating-date {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: var(--dark);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  border-left: 2px solid rgba(255, 255, 255, .3);
  z-index: 1;
}

/* ══ EDITION LABEL ══════════════════════════════════════════════ */
#edition-bar {
  padding: 8px 16px;
  background: var(--light);
  border-bottom: 1.5px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.edition-text {
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--dark);
}

.edition-text span {
  color: var(--red)
}

#readers-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--mid);
  font-weight: 600;
}

#readers-badge i {
  color: var(--red)
}

/* ══ PDF VIEWER ══════════════════════════════════════════════════ */
#viewer-wrap {
  position: relative;
  background: #2a2a2a;
  overflow: hidden;
  touch-action: none;
  height: calc(100svh - var(--hh) - 32px);
  height: 90vh;
  padding-top: 30px;
  width: 100%;
}

#pdf-canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

canvas#pdf-canvas {
  display: block;
  cursor: grab;
  transform-origin: center center;
  /* max-width: 100%; */
  transition: transform 0.1s ease-out; /* Smooths out the zoom/pan */
}

canvas#pdf-canvas:active {
  cursor: grabbing
}
/* Update the viewer wrap for large screens */
@media (min-width: 768px) {
    #viewer-wrap {
        height: 85vh; /* Give it more height on desktop */
        background: #333;
    }

    #pdf-canvas-container {
        /* On desktop, we want to allow natural vertical scrolling if needed */
        align-items: flex-start; /* Align paper to top */
        overflow-y: auto; 
        display: block; /* Change from flex to block for natural scrolling */
    }

    #pdf-canvas {
        margin: 0 auto; /* Center the paper horizontally */
    }
}

.viewer-controls {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 50;
}

.viewer-btn {
  background: rgba(0, 0, 0, .7);
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: .8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(6px);
  transition: .2s;
  font-weight: 600;
}

.viewer-btn:hover {
  background: var(--red)
}

.viewer-btn:disabled {
  opacity: .4;
  cursor: default
}

#page-counter {
  background: rgba(0, 0, 0, .7);
  color: var(--white);
  border-radius: 20px;
  padding: 7px 12px;
  font-size: .8rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.zoom-controls {
  position: absolute;
  bottom: 80px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

.zoom-btn {
  background: rgba(0, 0, 0, .65);
  color: var(--white);
  border: none;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: .2s;
}

.zoom-btn:hover {
  background: var(--red)
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  gap: 14px;
  z-index: 100;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, .2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.loading-text {
  font-size: .85rem;
  color: #aaa;
  font-family: 'Noto Sans Kannada', sans-serif
}

/* Swipe Hint */
.swipe-hint {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .6);
  color: var(--white);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .72rem;
  animation: fadeHint 3s ease forwards;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

@keyframes fadeHint {
  0% {
    opacity: 0
  }

  20% {
    opacity: 1
  }

  80% {
    opacity: 1
  }

  100% {
    opacity: 0
  }
}

/* ══ VIDEO SECTION ══════════════════════════════════════════════ */
#video-section {
  padding: 20px 16px;
  background: var(--light);
  border-top: 3px solid var(--red);
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: var(--red);
  border-radius: 2px
}

.video-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15)
}

.video-thumb {
  position: relative;
  /* aspect-ratio: 16/9; */
  background: #111;
  overflow: hidden
}

.video-thumb img {
  width: 100%;
  height: 100%;
  /* object-fit: fill */
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background: rgba(192, 57, 43, .9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.2rem;
  padding-left: 3px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

.video-meta {
  padding: 10px 12px;
  font-size: .82rem;
  color: var(--mid);
  font-weight: 500
}

/* ══ NEW VIDEO POPUP ════════════════════════════════════════════ */
#new-video-popup {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
  padding: 14px 18px;
  max-width: 320px;
  width: 90%;
  z-index: 2500;
  border-left: 4px solid var(--red);
  opacity: 0;
  pointer-events: none;
  transition: all .4s cubic-bezier(.34, 1.56, .64, 1);
}

#new-video-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0)
}

.popup-title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--red);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px
}

.popup-title i {
  animation: pulse 1s infinite
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.2)
  }
}

.popup-sub {
  font-size: .8rem;
  color: var(--mid)
}

.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px
}

.popup-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
}

.popup-btn.primary {
  background: var(--red);
  color: var(--white)
}

.popup-btn.secondary {
  background: #eee;
  color: var(--mid)
}

/* ══ FOOTER ══════════════════════════════════════════════════════ */
#footer {
  background: var(--dark);
  color: #ccc;
  padding: 24px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--white);
  margin-bottom: 6px
}

.footer-tagline {
  font-family: 'Noto Sans Kannada', sans-serif;
  font-size: .78rem;
  color: #aaa;
  margin-bottom: 14px;
  line-height: 1.5
}

.footer-desc {
  font-size: .8rem;
  color: #999;
  line-height: 1.6;
  margin-bottom: 16px
}

.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.social-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--white);
  text-decoration: none;
  transition: .2s;
}

.social-links a.fb {
  background: #1877f2
}

.social-links a.ig {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%)
}

.social-links a.yt {
  background: #ff0000
}

.social-links a.tw {
  background: #000
}

.social-links a.wa {
  background: #25d366
}

.social-links a:hover {
  transform: scale(1.1)
}

.footer-divider {
  border: none;
  border-top: 1px solid #333;
  margin: 12px 0
}

.footer-contact {
  font-size: .78rem;
  color: #aaa;
  margin-bottom: 4px
}

.footer-contact span {
  color: var(--white);
  font-weight: 600
}

.footer-copy {
  font-size: .72rem;
  color: #666;
  line-height: 1.5
}

.footer-atelier {
  color: #aaa;
  font-size: .72rem;
  margin-top: 4px
}

.footer-atelier a {
  color: #00ffff;
  /* color: #00bcd4; */
  text-decoration: none
}

/* ══ FLOATING BUTTONS ═══════════════════════════════════════════ */
#float-btns {
  position: fixed;
  bottom: 20px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1200
}

#float-btnsLeft {
  position: fixed;
  bottom: 20px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1200
}

.float-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--white);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .3);
  transition: .2s;
  text-decoration: none;
}

.float-btn:hover {
  transform: scale(1.1)
}

.float-btn.phone {
  background: var(--red);
  left: 0%;
}

.float-btn.whatsapp {
  background: #25d366
}

/* ══ NO PDF STATE ════════════════════════════════════════════════ */
.no-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #aaa;
  gap: 12px;
  padding: 20px;
  text-align: center;
}

.no-pdf i {
  font-size: 3rem;
  color: #555
}

.no-pdf p {
  font-size: .9rem;
  line-height: 1.5
}

/* ══ UTILITY ═════════════════════════════════════════════════════ */
.hidden {
  display: none !important
}

/* Premium Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--white);
  width: 100%;
  max-width: 450px;
  border-radius: 15px;
  padding: 25px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--red);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: 'Noto Sans Kannada', sans-serif;
  color: var(--red);
  font-size: 1.2rem;
}

.close-modal {
  font-size: 1.8rem;
  cursor: pointer;
  color: #999;
}

/* Form Styles */
#articleForm input,
#articleForm textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
}

#readers-badge {
    display: flex;
    align-items: center;
    /* gap: 8px; */
    background: rgb(0, 0, 0); 
    padding: 4px 12px;
    /* border-radius: 20px; */
    border-bottom-right-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1d36c4; /* Dark text */
    position: fixed;
    top: 6.5vh;
    left: 0%;
    z-index: 2500;
    white-space: nowrap; /* Prevents text from wrapping to a second line */
}
@media (min-width:768px) {
  #readers-badge{
    /* left: 35%; */
    top: 10vh;
  }  
}

#readers-badge i {
    color: #020ee7; /* Deep Red Eye Icon */
    font-size: 25px;
}

#reader-count-display {
    color: #2b96c0;
    font-size: 1rem;
}

#thumb-sidebar {
    width: 180px;
    height: 100%;
    background: #222;
    overflow-y: auto;
    border-right: 1px solid #444;
    padding: 10px;
    display: none; /* Hidden by default */
    flex-direction: column;
    gap: 15px;
}

/* Show only on Desktop */
@media (min-width: 768px) {
    #pdf-canvas-container {
        display: flex !important; /* Side-by-side layout */
        flex-direction: row;

    }
    #thumb-sidebar {
        display: flex;
        width: 250px;
    }
}

.thumb-item {
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    border: 5px solid transparent; /* Reserve space for border */
    border-radius: 4px;
    background: #333;
}

.thumb-item:hover {
    transform: scale(1.02);
}

.thumb-item.active {
    border-color: #C0392B; /* Your theme red */
    box-shadow: 0 0 10px rgba(192, 57, 43, 0.5);
}

.thumb-item canvas {
    width: 100%;
    height: auto;
    display: block;
}
/* Update these specific blocks in your CSS */

#thumb-sidebar {
    width: 200px; /* Slightly wider for better visibility */
    min-width: 200px; /* Prevents it from being squashed */
    height: 100%;
    background: #1a1a1a;
    overflow-y: auto;
    border-right: 2px solid #333;
    padding: 15px;
    display: none; 
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin; /* Clean scrollbar for Firefox */
    scrollbar-color: #444 #1a1a1a;
}

/* Ensure the wrapper and canvas fill the sidebar */
.thumb-item {
    width: 100%; /* Fills the 200px sidebar */
    cursor: pointer;
    border: 5px solid transparent; 
    border-radius: 6px;
    background: #000;
    overflow: hidden;
    display: block;
    box-sizing: border-box; /* Crucial so border doesn't add to width */
}

.thumb-item canvas {
    width: 100% !important; /* Force the canvas to stretch to wrapper width */
    height: auto !important;
    display: block;
}

.thumb-item.active {
    border-color: #C0392B;
    transform: scale(1.05); /* Slight pop-out effect for active page */
}

@media (min-width: 768px) {
    #pdf-canvas-container {
        display: flex !important;
        flex-direction: row;
        align-items: stretch; /* Ensures sidebar and main view are same height */
    }
    
    #pdf-canvas {
        flex-grow: 1; /* Main paper takes up all remaining space */
        /* Remove any fixed widths from the main canvas here */
    }
}