@import url("variables.css");

/* Font optimizations and system */
/* Font size reset to prevent layout shift */
html {
  font-size: 16px;
}

/* Font system for different scripts */
:root {
  --font-arabic: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
  --font-urdu: "Noto Sans Urdu", "Noto Nastaliq Urdu", "Arial Unicode MS",
    sans-serif;
  --font-latin: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  /* Adding font family variables with system fallbacks */
  --font-amiri: "Amiri", "Traditional Arabic", "Arabic Typesetting", serif;
  --font-scheherazade: "Scheherazade New", "Amiri", "Arabic Typesetting", serif;
  --font-noto-naskh: "Noto Naskh Arabic", "Amiri", "Arabic Typesetting", serif;
  --font-reem-kufi: "Reem Kufi", "Arabic Typesetting", sans-serif;
  --font-cairo: "Cairo", "Arabic Typesetting", sans-serif;
  /* Urdu font families with fallbacks */
  --font-urdu-typesetting: "Urdu Typesetting", "Noto Nastaliq Urdu",
    "Noto Sans Urdu", "Arial Unicode MS", sans-serif;
  --font-alvi-nastaleeq: "Alvi Nastaleeq", "Urdu Typesetting", serif;
  --font-noto-tajawal: "Tajawal", "Noto Sans Urdu", "Arial Unicode MS", serif;
  /* English font families with fallbacks */
  --font-roboto: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-open-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-lato: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-montserrat: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  --font-poppins: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
  /* Colors */
  --primary-color: #2a9d8f;
}

/* Default to system fonts while custom fonts load */
body {
  font-family: var(--font-latin);
  top: 0 !important;
  background-color: var(--background);
  margin: 0;
  color: var(--gray-900);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Arabic text styling with containment */
.arabic-text,
[lang="ar"],
.quran-text {
  font-family: var(--font-arabic);
  line-height: 1.6;
  word-spacing: 0.1em;
  text-rendering: optimizeLegibility;
}

/* Urdu text styling */
[lang="ur"],
.urdu-text {
  font-family: var(--font-urdu);
  line-height: 1.8;
}

/* Data attribute based font selection */
/* Arabic fonts */
.arabic-text[data-font="Amiri"],
[lang="ar"][data-font="Amiri"] {
  font-family: var(--font-arabic-amiri) !important;
}

.arabic-text[data-font="Scheherazade New"],
[lang="ar"][data-font="Scheherazade New"] {
  font-family: var(--font-arabic-scheherazade) !important;
}

.arabic-text[data-font="Noto Naskh Arabic"],
[lang="ar"][data-font="Noto Naskh Arabic"] {
  font-family: var(--font-arabic-noto) !important;
}

.arabic-text[data-font="Reem Kufi"],
[lang="ar"][data-font="Reem Kufi"] {
  font-family: var(--font-reem-kufi);
}

.arabic-text[data-font="Cairo"],
[lang="ar"][data-font="Cairo"] {
  font-family: var(--font-cairo);
}

/* Urdu fonts */
.urdu-text[data-font="Noto Nastaliq Urdu"],
[lang="ur"][data-font="Noto Nastaliq Urdu"] {
  font-family: var(--font-noto-nastaliq) !important;
}

.urdu-text[data-font="Noto Sans Urdu"],
[lang="ur"][data-font="Noto Sans Urdu"] {
  font-family: var(--font-urdu-sans) !important;
}

.urdu-text[data-font="Nafees Web Naskh"],
[lang="ur"][data-font="Nafees Web Naskh"] {
  font-family: var(--font-noto-tajawal) !important;
}

/* English fonts */
.english-text[data-font="Roboto"] {
  font-family: var(--font-english-roboto) !important;
}

.english-text[data-font="Open Sans"] {
  font-family: var(--font-open-sans);
}

.english-text[data-font="Lato"] {
  font-family: var(--font-lato);
}

.english-text[data-font="Montserrat"] {
  font-family: var(--font-montserrat);
}

.english-text[data-font="Poppins"] {
  font-family: var(--font-poppins);
}

/* Prevent layout shift by reserving vertical space */
.text-container {
  min-height: 1.5em;
  contain: content;
}

/* Font rendering optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent text zoom on mobile when user taps form inputs */
input,
select,
textarea {
  font-size: 16px; /* Prevents iOS zoom */
}

/* Better handling of RTL/Arabic/Urdu text */
[dir="rtl"],
[lang="ar"],
[lang="ur"] {
  /* Improves legibility for Arabic/Urdu text */
  letter-spacing: 0;
  text-align: right;
}

/* Ensure images don't overflow container on mobile */
img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .arabic-text,
  [lang="ar"],
  .quran-text {
    font-size: 1.1rem; /* Slightly larger on mobile for better readability */
    line-height: 1.7;
  }

  /* Increase touch targets for better mobile usability */
  button,
  .btn,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve text readability on small screens */
  p,
  li,
  td,
  th {
    font-size: 1rem;
    line-height: 1.5;
  }

  /* Fix Arabic text on mobile */
  [dir="rtl"],
  [lang="ar"],
  .arabic-text {
    /* Prevent overlapping characters in Arabic script */
    letter-spacing: 0.01em;
    word-spacing: 0.05em;
  }

  /* Prevent double-tap zoom on clickable elements */
  a,
  button,
  .clickable {
    touch-action: manipulation;
  }
}

.goog-te-gadget .goog-te-combo {
  width: 100%;
  padding: 10px 5px;
  border-radius: 8px;
}
.goog-te-gadget,
.goog-te-gadget a {
  color: transparent !important;
  font-size: 0 !important;
}
.goog-te-gadget a {
  pointer-events: none;
}
.goog-te-gadget a img,
.goog-te-gadget span {
  display: none !important;
}

html:lang(ur) .main-content,
html:lang(ar) .main-content {
  direction: rtl;
}

.language-switcher {
  margin-bottom: 30px;
}
.back-to-english {
  display: none;
  cursor: pointer;
  /* margin-top: -15px; */
  padding: 5px;
  background-color: var(--primary);
  color: white;
  border-radius: 5px;
  text-align: center;
}
html:lang(ur) .back-to-english,
html:lang(ar) .back-to-english {
  display: block;
}

/* Hide Google Translate Ends */

/* Basic element styling */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--primary);
  margin-bottom: 20px;
}

p {
  margin-bottom: 20px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

button {
  cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 20px;
}

footer .container {
  position: relative;
  z-index: 1;
}

.container-books {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-player {
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  display: block;
  height: 100%;
  /* justify-content: center;
  align-items: center; */
}

.video-player video {
  width: 100%;
  height: 70vh;
  /*max-width: 700px;
  max-height: 700px; */
}

.video-list {
  display: flex;
  flex-direction: column;
  width: 40%;
  padding: 30px;
  overflow: auto;
}

@media (max-width: 1024px) {
  .video-list {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: block;
  }
}

.video-list::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari, and Opera */
}

.video-item {
  flex: 0 0 auto;
  width: 100%;
  cursor: pointer;
  transition: transform 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--white);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

.video-item img {
  width: 100%;
  height: 150px;
  display: block;
}

.video-title {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-description {
  padding: 2px;
  font-size: 0.7em;
  color: var(--secondary);
  text-align: center;
}

.video-item:hover {
  transform: translateY(-8px);
  /* border-color: var(--primary); */
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.header {
  background-color: var(--primary);
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.content-container {
  flex: 1;
  margin-left: 300px;
  padding: 20px;
  transition: margin-left 0.3s ease;
}

.content-container.admin {
  margin-left: 0;
  width: 100%;
}

.content-container-lectures {
  display: flex;
  width: 100%;
  overflow: auto;
}

@media screen and (max-width: 1024px) {
  .content-container-lectures {
    display: block;
  }
}

.page-title {
  font-size: 2.5em;
  font-weight: 800;
  margin-bottom: 40px;
  color: var(--primary-dark);
  text-align: center;
}

.welcome-user {
  font-size: 1.2em;
  color: var(--gray-600);
  margin-bottom: 30px;
  text-align: center;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
  justify-content: center;
}

/* Single card centering */
.video-grid:has(.video-card:only-child) {
  grid-template-columns: minmax(250px, 350px);
}

/* Two cards */
.video-grid:has(.video-card:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(250px, 350px));
}

.static-pdf-card {
  background: var(--primary-transparent) !important;
  border-left: 3px solid var(--primary);
  height: auto;
  max-height: 100px;
  padding: 10px !important;
  margin-bottom: 10px;
  border-radius: 10px;
  display: flex !important;
  flex-direction: column !important;
}

.static-pdf-card h4 {
  margin: 0px;
}

.video-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.video-card video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--gray-900);
  transition: all 0.3s ease;
}

.video-card video::-webkit-media-controls-panel {
  background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.video-card video::-webkit-media-controls-play-button {
  background-color: var(--primary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.video-card video::-webkit-media-controls-timeline {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  height: 3px;
}

.video-card video::-webkit-media-controls-current-time-display,
.video-card video::-webkit-media-controls-time-remaining-display {
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.video-info {
  padding: 1rem;
  background: var(--white);
  border-radius: 0 0 8px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.video-date {
  font-size: 0.9em;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-date::before {
  content: "•";
  font-size: 1.2em;
  color: var(--primary);
}

.video-card:hover .error-message {
  transform: translateY(0);
}

.video-thumbnail-container {
  position: relative;
  cursor: pointer;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease;
  z-index: 1;
}

.play-button:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.video-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

.video-thumbnail-placeholder {
  width: 100%;
  height: 220px;
  background-color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #666;
  font-size: 1.2em;
  text-align: center;
}
video {
  width: 100%;
}

@media (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(1, minmax(200px, 350px));
    gap: 1rem;
    padding: 1rem;
  }

  .video-info {
    padding: 0.75rem;
  }

  .video-info h3 {
    font-size: 1rem;
  }

  .video-info p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

.header {
  background-color: var(--primary);
  padding: 1rem 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sign-out-button {
  background-color: transparent;
  color: var(--white);
  border: 1px solid var(--white);
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sign-out-button:hover {
  background-color: var(--primary-light);
  color: #333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  color: var(--primary-dark);
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
}

.upload-section {
  background: var(--gray-100);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
  border: 1px solid var(--gray-200);
}

.upload-section h2 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 1.5em;
  font-weight: 700;
}

.upload-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: end;
}

.form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.95em;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  background-color: var(--white);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-transparent);
  outline: none;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95em;
  align-self: flex-end;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-transparent);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 2rem 0;
}

.header-cell {
  padding: 1rem;
  text-align: center;
  background: var(--primary);
  color: var(--white);
  font-weight: bold;
}

.cell {
  padding: 0.5rem;
  text-align: left;
  background: var(--white);
  transition: background-color 0.3s ease;
}

.cell:hover {
  background-color: var(--primary-transparent);
}

.video-description,
.video-type,
.video-date,
.video-order {
  text-align: center;
}

.action-buttons {
  text-align: center;
}

.btn-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  margin: 0 5px;
  font-size: 1em;
  transition: transform 0.2s ease;
}

.btn-action:hover {
  background-color: var(--primary-light);
}

.btn-preview {
  background-color: var(--primary-transparent);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

.btn-preview:hover {
  background-color: var(--primary);
  color: var(--white);
}

.btn-delete {
  background-color: var(--danger-transparent);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-delete:hover {
  background-color: var(--danger);
  color: var(--white);
}

/* General Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* Default Modal Content Style */
.modal-content {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--gray-600);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  transition: all 0.3s ease;
  z-index: 1;
}

.modal-close:hover {
  color: var(--danger);
  transform: scale(1.1);
}

.modal h2 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 1.5em;
  font-weight: 700;
}

/* PDF Viewer Modal Specific Styling */
#pdfModal.modal {
  padding: 0;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
}

#pdfModal.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#pdfModal .modal-content {
  width: 90%;
  height: 90vh;
  max-width: 1200px;
  margin: auto;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#pdfModal .modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pdfModal .modal-header h2 {
  margin: 0;
  color: var(--gray-900);
}

#pdfModal .close-modal {
  position: static;
  font-size: 28px;
  font-weight: bold;
  padding: 0;
  cursor: pointer;
  color: var(--gray-600);
  transition: color 0.2s ease;
}

#pdfModal .close-modal:hover {
  color: var(--gray-900);
}

#pdfModal .modal-body {
  flex: 1;
  padding: 20px;
  height: calc(100% - 70px);
  overflow: hidden;
}

#pdfViewer {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: white;
}

/* Upload PDF Modal Specific Styling */
#pdfModal .modal-content {
  max-width: 600px;
  padding: 2rem;
}

#pdfModal .form-group {
  margin-bottom: 1.5rem;
}

#pdfModal .form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  margin-top: 0.5rem;
}

#pdfModal .btn-primary {
  width: 100%;
  margin-top: 1rem;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

.message {
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
  font-weight: 500;
}

.message.success {
  background-color: var(--primary-transparent);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}

.message.error {
  background-color: var(--danger-transparent);
  color: var(--danger);
  border: 1px solid var(--danger);
}

/* Table wrapper for potential horizontal scroll on mobile */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

@media (max-width: 1024px) {
  .videos-header {
    display: none; /* Hide headers on mobile */
  }

  .video-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    /* padding: 1.25rem; */
  }

  .video-type::before {
    content: "Type: ";
    font-weight: 500;
    color: var(--secondary);
  }

  .video-date::before {
    content: "Uploaded: ";
    font-weight: 500;
    color: var(--secondary);
  }

  .action-buttons {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .btn-action {
    flex: 1;
  }
}

/* Add these styles to your existing modal styles */
.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-content .form-group {
  margin-bottom: 0;
}

.modal-content .btn-primary {
  margin-top: 1rem;
  align-self: flex-end;
  min-width: 120px;
}

@media (max-width: 768px) {
  .modal-content .btn-primary {
    width: 100%;
  }
}

/* Additional styles for text alignment */
.video-description,
.video-type,
.video-date {
  text-align: center; /* Center align these columns */
}

.category-tree {
  margin-top: 20px;
}

.category-tree ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.category-tree ul ul {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid var(--gray-200);
}

.category-tree li {
  margin: 0;
  padding: 10px 5px;
  position: relative;
  cursor: pointer;
  color: var(--secondary);
}

.category-tree .tree-icon {
  margin-right: 5px;
  cursor: pointer;
}

.category-tree li::before {
  content: "";
  position: absolute;
  top: 0;
  left: -20px;
  border-top: 1px solid var(--gray-200);
  width: 20px;
  height: 50%;
}

.category-tree li::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  border-left: 1px solid var(--gray-200);
  width: 20px;
  height: 50%;
}

.category-tree li:last-child::after {
  display: none;
}

.landing-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: url("/assets/bg-img.jpg");
}

.bismillah-image {
  width: 40%;
  display: flex;
  margin: 20px auto;
}

@media screen and (max-width: 1024px) {
  .bismillah-image {
    width: 70%;
  }
}

.hero-section {
  /* background: var(--white); */
  color: var(--white);
  padding: 20px;
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  right: 19%;
  bottom: 20%;
}

.form-content {
  width: 80%;
  display: flex;
  gap: 50px;
  justify-content: center;
  align-items: center;
  margin: auto;
}

.hero-text {
  flex: 1;
  text-align: left;
}

.hero-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: 1.3em;
  margin-bottom: 40px;
  opacity: 0.9;
  line-height: 1.6;
  color: var(--primary-dark);
}

.auth-container {
  flex: 1;
  max-width: 400px;
  /* background: var(--white); */
  background: var(--primary-dark);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.auth-tabs {
  display: flex;
  margin: -2rem -2rem 2rem -2rem;
  border-bottom: 2px solid var(--primary);
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  color: var(--primary-light);
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.auth-tab.active {
  color: var(--white);
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--gray-200);
  transition: all 0.3s ease;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.95em;
}

.form-group input {
  /* width: 100%; */
  flex: 1;
  padding: 12px;
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  background-color: var(--white);
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-transparent);
  outline: none;
}

.submit-btn {
  width: 100%;
  padding: 12px;
  margin: 20px 0px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-transparent);
}

.features-section {
  padding: 80px 20px;
  background: var(--white);
}

.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  padding: 20px;
}

.feature-card {
  text-align: center;
  padding: 40px 30px;
  border-radius: 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  background: var(--white);
}

.feature-icon {
  font-size: 3em;
  color: var(--primary);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-title {
  font-size: 1.5em;
  margin-bottom: 15px;
  color: var(--secondary);
  font-weight: 700;
}

.feature-description {
  color: var(--gray-600);
  line-height: 1.6;
}

.error-message {
  padding: 15px;
  border-radius: 8px;
  background-color: var(--danger-transparent);
  color: var(--danger);
  border: 1px solid var(--danger);
  font-weight: 500;
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  align-items: center;
  justify-content: center;
  height: min-content;
}

@media (max-width: 968px) {
  .form-content {
    width: 100%;
    padding: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero-content {
    flex-direction: column;
    text-align: center;
  }
  .hero-text {
    text-align: center;
  }
  .hero-title {
    font-size: 1.7em;
  }
  .hero-subtitle {
    font-size: 1.2em;
  }
  .auth-container {
    width: 90%;
  }
}

.videos-table,
.user-panel .videos-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 1rem;
}

.videos-table th,
.videos-table td,
.user-panel .videos-table th,
.user-panel .videos-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--secondary);
  text-align: left;
}

.videos-table th,
.user-panel .videos-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
}

.btn-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  margin: 0 5px;
  font-size: 1em;
  transition: transform 0.2s ease;
}

.btn-action:hover {
  transform: scale(1.1);
}

/* Add this class to handle collapsed state */
.content-container.sidebar-collapsed {
  margin-left: 100px;
}

@media (max-width: 768px) {
  .content-container {
    margin-left: 0;
    padding: 15px;
  }

  .content-container.sidebar-collapsed {
    margin-left: 0;
  }

  .sidemenu-container {
    width: 250px;
    transform: translateX(-100%);
  }

  .sidemenu-container.collapsed {
    transform: translateX(-100%);
  }

  .sidemenu-container.open {
    transform: translateX(0);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif; /* Global font family */
}

body {
  background: #f5f5f5;
}

.hero-mini-img {
  width: 50%;
  height: 100%;
  display: flex;
  position: relative;
  /* right: 30%; */
}

.hero-content-inner {
  display: flex;
  flex-direction: column;
  margin: auto;
}

.hero-title {
  color: #b2a51f;
  display: flex;
  font-size: 2.5rem;
}

.hero-description {
  color: #b2a51f;
  display: flex;
  font-size: 1rem;
  text-align: left;
}

.hero-banner {
  position: relative;
  height: auto;
  background-image: url(/assets/hero-banner.jpg);
  background-size: cover;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0px;
}

.hero-banner-ayat {
  position: relative;
  height: 450px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-banner-hadees {
  position: relative;
  height: auto;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-image: url(/assets/masjid-nabwi-bg.png);
  background-size: auto;
  background-position-y: 100%;
  background-repeat: no-repeat;
  overflow: hidden;
  border-top: 3px solid #b2a51f;
  /* border-bottom: 3px solid #b2a51f; */
  border-right: 3px solid #b2a51f;
}

@media screen and (max-width: 768px) {
  .hero-banner-hadees {
    height: auto;
    border-top: 0;
    border-bottom: 3px solid #b2a51f;
    border-right: 0;
    background-size: cover !important;
    background-position: 100%;
    background-repeat: repeat;
  }

  .arabic-text {
    font-size: 1rem;
  }

  .hadees-content .arabic-text {
    font-size: 1rem;
  }

  .hero-banner {
    position: relative;
    height: auto;
    background-image: url(/assets/hero-banner.jpg);
    background-size: cover;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
  }
  .hero-content {
    position: unset;
    z-index: 2;
    max-width: 800px;
    right: 15%;
    display: flex;
    flex-direction: column;
  }
  .hero-mini-img {
    width: 90%;
    display: flex;
    position: relative;
  }
  .hero-content-inner {
    display: flex;
    flex-direction: column;
    margin: auto;
    justify-content: center;
    align-items: center;
    background: #ffffff38;
    padding: 20px;
  }
  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 1rem;
    margin-bottom: 0px;
  }
  .hero-content {
    position: unset !important;
    z-index: 2;
    max-width: 800px;
    right: 15%;
    display: flex;
    flex-direction: column;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
  right: 15%;
  /* display: flex; */
  /* flex-direction: column; */
}

.hero-content h1 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1rem;
  margin-bottom: 30px;
}

.cta-button {
  padding: 15px 40px;
  font-size: 1.2rem;
  background: white;
  color: #2563eb;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
}

section {
  padding: 80px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 50px;
  color: var(--primary-dark);
}

.shahadah-section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0;
  margin-top: -100px;
  color: var(--primary-light);
  background: rgb(0 0 0 / 48%);
}

.prayer-section-title {
  font-size: 2rem;
  text-align: center;
  color: var(--primary-light);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature-card {
  background: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.feature-card svg {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #1e293b;
}

.feature-card p {
  color: #64748b;
  line-height: 1.6;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.video-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
  position: relative;
  padding-top: 56.25%;
  background: #e2e8f0;
}

.video-info {
  padding: 20px;
}

.video-info h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #1e293b;
}

.video-info p {
  color: #64748b;
  font-size: 0.9rem;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.book-card {
  height: 350px;
  width: 250px;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

@media screen and (max-width: 768px) {
  .book-card {
    width: 100%;
  }
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.book-card img {
  width: 200px;
  height: 280px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.book-card .default-thumbnail {
  width: 200px;
  height: 280px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.book-card .default-thumbnail i {
  font-size: 4rem;
  color: var(--primary);
}

.book-card h3 {
  font-size: 1.2rem;
  color: var(--gray-900);
  margin: 0.5rem 0;
  text-align: center;
}

.book-card .author {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.book-card .description {
  color: var(--gray-700);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
  line-height: 1.4;
}

.no-books-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: var(--gray-600);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  padding-top: 100%;
  border-radius: 10px;
  overflow: hidden;
}

.gallery-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

footer {
  background: #0e2819;
  /* background-image: url("assets/lantern-img.png"); */
  position: relative;
  border-top: 3px solid #cab04a;
  color: white;
  padding: 80px 40px 20px;
  background-position-y: 7%;
  background-size: cover;
  overflow: hidden;
}

footer .lantern-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

html.translated-rtl .lantern-img {
  transform: scaleX(-1);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--primary-light);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #e2e8f0;
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 2rem;
  }
}

.prayer-times-section {
  /* background: linear-gradient(to right, #1e293b, #334155); */
  background-image: url("assets/prayers-time-bg.jpg");
  color: var(--primary-light);
  padding: 20px;
  background-size: cover;
}
.prayer-times-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.prayer-times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin: 0px 50px;
}

.prayer-time-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 3px;
  border-radius: 10px;
  text-align: center;
  backdrop-filter: blur(5px);
  transition: transform 0.3s ease;
}

.prayer-time-card:hover {
  transform: translateY(-5px);
}

.prayer-name {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--primary-light);
}

.prayer-time {
  font-size: 1.2rem;
  color: #b2a51f;
}

.last-updated {
  text-align: center;
  margin-top: 20px;
  color: #94a3b8;
  font-size: 0.9rem;
}

.next-prayer {
  text-align: center;
  margin: 20px 50px 0px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

@media screen and (max-width: 768px) {
  .next-prayer {
    display: flex;
    flex-direction: column;
  }
}

.next-prayer h3 {
  color: var(--primary-light);
  margin: 0px;
  font-size: 1.5rem;
}

.next-prayer-time {
  font-size: 1.5rem;
  color: #b2a51f;
  font-weight: 600;
}

@media (max-width: 768px) {
  .next-prayer-time,
  .next-prayer h3 {
    font-size: 1rem;
  }
}

.date-section {
  /* background: linear-gradient(to right, var(--primary-dark), var(--primary)); */
  color: white;
  background-image: url("assets/prayers-time-bg.jpg");
  background-size: cover;
  padding: 0px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-container {
  max-width: auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0px;
}

.date-box {
  text-align: center;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  width: 25%;
}

.date-label {
  font-size: 0.9rem;
  color: #b2a51f;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.date-value {
  /* font-size: 1.2rem; */
  color: #b2a51f;
  font-weight: 500;
}

.current-time {
  font-size: 1.8rem;
  font-weight: bold;
  color: #b2a51f;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 25px;
  border-radius: 8px;
  min-width: 200px;
  text-align: center;
}

.quran-marquee {
  font-family: "Amiri", serif;
  color: #fff;
  font-size: 28px;
  padding: 10px;
  width: 70%;
  background: transparent;
}

@media screen and (max-width: 768px) {
  .quran-marquee {
    font-family: "Amiri", serif;
    color: #fff;
    font-size: 28px;
    padding: 5px 0 0 0;
    width: 100%;
    background: transparent;
  }
}

@media (max-width: 768px) {
  .date-container {
    flex-direction: column;
    text-align: center;
  }

  .date-box {
    width: 100%;
  }

  .current-time {
    width: 100%;
  }
}

.quran-marquee-container {
  background: linear-gradient(to right, var(--primary-dark), var(--primary));
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

marquee {
  padding: 10px 0;
}

.arabic-text {
  color: var(--primary-light);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  line-height: 1.8;
  font-size: 1.3rem;
}

.bismillah {
  color: var(--primary-light);
  margin-left: 20px;
  margin-right: 20px;
}

.ayah-separator {
  color: var(--primary-light);
  margin: 0 15px;
  font-size: 24px;
  display: inline-block;
  vertical-align: middle;
}

.admin-section {
  display: flex;
  flex-direction: column;
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-panel .admin-header h1 {
  color: var(--primary-dark);
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
}

.user-panel .table-wrapper {
  overflow-x: auto;
  margin: 0 -1rem;
  padding: 0 1rem;
  -webkit-overflow-scrolling: touch; /* Keep this line */
  /* Remove these duplicate lines */
  /* scrollbar-width: thin; */
  /* scrollbar-color: var(--primary) var(--gray-200); */
}

/* Ensure consistent styling between video and user tables */
.videos-table,
.user-panel .videos-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.videos-table th,
.videos-table td,
.user-panel .videos-table th,
.user-panel .videos-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  color: var(--secondary);
  text-align: left;
}

.videos-table th,
.user-panel .videos-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
}

.btn-action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  margin: 0 5px;
  font-size: 1em;
  transition: transform 0.2s ease;
}

.btn-action:hover {
  transform: scale(1.1);
}

@media (max-width: 1200px) {
  .videos-table td,
  .videos-table th,
  .user-panel .videos-table td,
  .user-panel .videos-table th {
    min-width: 120px; /* Ensure columns don't get too narrow */
  }

  .videos-table td:first-child,
  .videos-table th:first-child,
  .user-panel .videos-table td:first-child,
  .user-panel .videos-table th:first-child {
    position: sticky;
    left: 0;
    background: var(--white);
    z-index: 1;
  }

  .videos-table th:first-child,
  .user-panel .videos-table th:first-child {
    background: var(--primary);
  }
}

/* Update user table styles */
.user-panel .videos-table {
  min-width: 1200px; /* Ensure minimum width to prevent cramping */
}

.user-panel .videos-table td,
.user-panel .videos-table th {
  padding: 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap; /* Prevent text wrapping */
}

/* Style specific columns */
.user-panel .videos-table .username,
.user-panel .videos-table .email {
  min-width: 150px;
}

.user-panel .videos-table .phone,
.user-panel .videos-table .dob,
.user-panel .videos-table .gender {
  min-width: 120px;
}

.user-panel .videos-table .address {
  min-width: 200px;
  max-width: 300px;
  white-space: normal; /* Allow address to wrap */
  line-height: 1.4;
}

.user-panel .videos-table .current-video {
  min-width: 100px;
}

.user-panel .videos-table .actions {
  min-width: 80px;
  text-align: center;
}

/* Improve table wrapper scrolling */
.user-panel .table-wrapper {
  overflow-x: auto;
  margin: 0 -1rem;
  padding: 0 1rem;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--primary) var(--gray-200); /* Firefox */
}

/* Customize scrollbar for Webkit browsers */
.user-panel .table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.user-panel .table-wrapper::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: 4px;
}

.user-panel .table-wrapper::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .user-panel .videos-table td,
  .user-panel .videos-table th {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .user-panel .videos-table .address {
    max-width: 250px;
  }
}

@media (max-width: 768px) {
  .user-panel .videos-table {
    min-width: 900px; /* Slightly smaller minimum width for medium screens */
  }

  .user-panel .videos-table .username,
  .user-panel .videos-table .email {
    min-width: 120px;
  }

  .user-panel .videos-table .address {
    max-width: 200px;
  }
}

/* PDF Panel specific styles */
.pdf-panel .upload-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.pdf-panel .videos-table .pdf-name {
  min-width: 300px;
  white-space: normal;
  line-height: 1.4;
}

.pdf-panel .videos-table .upload-date {
  min-width: 150px;
}

.pdf-panel .videos-table .file-size {
  min-width: 100px;
}

/* PDF preview thumbnail */
.pdf-thumbnail {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
}

/* PDF icon when no thumbnail */
.pdf-icon {
  color: var(--danger);
  font-size: 1.5rem;
  margin-right: 10px;
}

/* PDF name with icon/thumbnail layout */
.pdf-name-container {
  display: flex;
  align-items: center;
}

/* Layout Structure */
body {
  display: flex;
  min-height: 100vh;
  margin: 0;
}

.sidemenu {
  width: 200px;
  background-color: var(--white);
  border-right: 3px solid #cab04a;
  transition: all 0.3s ease;
  height: 100vh;
  position: fixed;
  z-index: 1000;
}

.sidemenu.collapsed {
  width: 60px;
}

.sidemenu.collapsed .sidemenu-brand,
.sidemenu.collapsed .menu-text {
  display: none;
}

.menu-text-bold {
  font-weight: bold;
}

span.menu-text {
  font-weight: bold;
}

.main-content {
  flex: 1;
  margin-left: 200px;
  transition: margin-left 0.3s ease;
}

.main-content,
.main-wrapper {
  width: 100%;
}

.main-content.expanded {
  margin-left: 60px;
}

.sidemenu-toggle {
  display: none;
  padding: 1rem;
  cursor: pointer;
  text-align: right;
}

.sidemenu-toggle i {
  font-size: 1.5rem;
  color: var(--primary);
}

/* Menu Items */
.sidemenu-header {
  padding: 1rem 0px;
  border-bottom: 1px solid var(--gray-200);
}

.sidemenu-brand {
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .sidemenu {
    transform: translateX(-100%);
    width: 200px;
  }

  .sidemenu.active {
    transform: translateX(0);
  }

  .sidemenu-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .main-content.expanded {
    margin-left: 0;
  }

  /* Show toggle button on mobile */
  .sidemenu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--white);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

.favorite-star {
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  color: #ccc;
}

.favorite-star.active {
  color: #ffd700;
}

.favorite-star:hover {
  transform: scale(1.1);
}

.favorite-star.fas {
  color: #ffd700;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.default-thumbnail {
  background-color: var(--gray-200);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.default-thumbnail i {
  font-size: 3rem;
  color: var(--gray-400);
}

.no-videos-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: 8px;
  color: var(--gray-500);
}

.video-info {
  padding: 1rem;
  background: var(--white);
  border-radius: 0 0 8px 8px;
}

.video-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--primary-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.video-info p {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Favorite checkbox styling */
.favorite-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.5rem;
  border-radius: 4px;
  background: var(--gray-100);
}

.favorite-checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.favorite-checkbox-group input[type="checkbox"]:checked {
  background-color: var(--primary);
}

.favorite-checkbox-group input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.favorite-

/* Admin PDF Edit Modal Styling */
#pdfEditModal.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 2000;
}

#pdfEditModal.modal.active,
#pdfEditModal.modal[style*="display: block"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

#pdfEditModal .modal-content {
  width: 90%;
  max-width: 600px;
  margin: auto;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  padding: 2rem;
}

#pdfEditModal .modal-header {
  margin-bottom: 1.5rem;
}

#pdfEditModal .modal-header h2 {
  margin: 0;
  color: var(--primary-dark);
}

#pdfEditModal .close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  transition: color 0.2s ease;
}

#pdfEditModal .close-modal:hover {
  color: var(--gray-900);
}

.about-us-section {
  padding: 50px 20px;
  color: #fff;
  background-image: url(assets/lantern-img.png);
  background-size: cover;
  background-position-x: 90%;
}

@media screen and (max-width: 768px) {
  .about-us-section {
    background-image: url();
  }
}

.about-us-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0px;
}

.pillars-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

@media screen and (max-width: 768px) {
  .about-us-box-one {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .about-us-box-two {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}

.about-us-box-one {
  display: flex;
  gap: 3px;
}

.about-us-box-two {
  display: flex;
  gap: 20px;
}

.about-us-content {
  flex: 1;
  max-width: 40%;
  background: #8fbc8f36;
  padding: 20px;
  border: 1px solid var(--primary-light);
}

.about-us-title {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary-dark);
}

.about-us-description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--primary-dark);
}

.about-us-image {
  flex: 1;
  max-width: 50%;
}

.about-us-image img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}
.pillars-content {
  flex: 1;
  max-width: 100%;
  background: #8fbc8f36;
  padding: 20px;
  border: 1px solid var(--primary-light);
}

@media (max-width: 768px) {
  .pillars-content {
    max-width: 100%;
    text-align: center;
    border: 1px solid var(--primary-light);
  }

  .about-us-container {
    flex-direction: column;
  }

  .about-us-content {
    max-width: 100%;
    text-align: center;
    border: 1px solid var(--primary-light);
  }

  .about-us-image {
    max-width: 100%;
  }

  .about-us-title {
    font-size: 2rem;
  }
}

/* Upload Progress Styles */
.progress-container {
  margin-top: 15px;
  padding: 10px;
  background: var(--gray-100);
  border-radius: 4px;
}

.progress-container progress {
  width: 100%;
  height: 20px;
  margin-bottom: 5px;
}

.progress-container span {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--gray-600);
}

/* Style the progress bar */
progress {
  -webkit-appearance: none;
  appearance: none;
}

progress::-webkit-progress-bar {
  background-color: var(--gray-200);
  border-radius: 4px;
}

progress::-webkit-progress-value {
  background-color: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

progress::-moz-progress-bar {
  background-color: var(--primary);
  border-radius: 4px;
}

/* PDF Viewer Specific Styles */
#pdfViewerContainer {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

#pdfViewer {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: white;
  pointer-events: auto;
}

#pdfControls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
}

.btn-nav {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.btn-nav:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
}

#zoomSelect {
  margin-left: auto;
  padding: 0.25rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
}

.pdf-page {
  margin: 0 auto 1rem auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  background: white;
  max-width: 100%;
  width: 100% !important;
  height: auto !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: none;
}

.pdf-page:last-child {
  margin-bottom: 0;
}

#pdfModal {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version */
}

#pdfViewerContainer,
#pdfViewer,
.pdf-page {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Re-enable pointer events for controls */
#pdfControls,
#pdfControls * {
  pointer-events: auto;
}

/* Video Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 800px;
  border-radius: 8px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.close-modal {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#videoPlayer {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

#modalVideo {
  width: 100%;
  height: 100%;
}

.video-card {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.video-card:hover {
  transform: translateY(-5px);
}

#videoModal .modal-content {
  width: 90%;
  max-width: 1200px;
  margin: 2% auto;
  padding: 20px;
  background-color: #fff;
}

#videoPlayer {
  width: 100%;
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

#modalVideo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

#videoModal .modal-header {
  background: #fff;
  padding: 15px;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--gray-200);
}

#videoModal .close-modal {
  color: var(--gray-600);
}

#videoModal .close-modal:hover {
  color: var(--gray-900);
}

#videoModal .modal-body {
  padding: 0;
}

/* PDF Viewer Loading and Error States */
.loading,
.error {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 20px auto;
  background: #f5f5f5;
  border-radius: 4px;
}

.error {
  color: #ff0000;
  background: #fff0f0;
  border: 1px solid #ffdddd;
}

/* PDF Viewer Canvas Container */
.pdf-page {
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#pdfViewer {
  background: #f5f5f5;
  padding: 20px;
  min-height: 400px;
  overflow-y: auto;
}

/* Prevent text selection */
.prevent-select {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Chrome/Safari/Opera */
  -khtml-user-select: none; /* Konqueror */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version */
}

/* PDF Controls */
#pdfControls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.btn-nav {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-nav:hover {
  background: var(--primary-dark);
}

.btn-nav:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
}

#zoomSelect {
  margin-left: auto;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
}

/* PDF Modal specific styles */
#pdfModal .modal-content {
  width: 95%;
  max-width: 1200px;
  height: 90vh;
  margin: 2vh auto;
  display: flex;
  flex-direction: column;
}

#pdfModal .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#pdfViewerContainer {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#pdfViewer {
  flex: 1;
  overflow-y: auto;
  background: var(--gray-100);
}

/* PDF Skeleton Loading */
.pdf-skeleton {
  padding: 2rem;
  background: var(--white);
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.skeleton-header {
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.skeleton-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--loading-progress, 0%);
  height: 3px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.skeleton-bar {
  height: 2rem;
  background: var(--gray-200);
  border-radius: 4px;
  margin-bottom: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-bar.short {
  width: 60%;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.skeleton-line {
  height: 1rem;
  background: var(--gray-200);
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line.short {
  width: 70%;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.6;
  }
}

/* PDF Error State */
.pdf-error {
  padding: 2rem;
  text-align: center;
  background: var(--danger-transparent);
  border-radius: 8px;
  margin: 1rem;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.retry-button {
  padding: 0.5rem 1.5rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.retry-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.retry-button:active {
  transform: translateY(0);
}

/* PDF Page Loading Overlay */
.page-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Spinner Animation */
.spinner {
  display: flex;
  gap: 4px;
  padding: 20px;
}

.spinner > div {
  width: 12px;
  height: 12px;
  background-color: var(--primary);
  border-radius: 100%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Make sure pdfViewer has relative positioning for overlay */
#pdfViewer {
  position: relative;
  background: var(--gray-100);
  min-height: 400px;
  overflow-y: auto;
}

.video-modal {
  max-width: 600px; /* Match the width of edit modal */
  width: 90%;
}

.modal-content.video-modal .form-group {
  margin-bottom: 15px;
}

.modal-content.video-modal textarea {
  min-height: 100px;
}

/* Form actions with inline progress */
.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 15px;
}

.inline-progress {
  flex: 1;
  max-width: 300px;
  display: flex;
  align-items: center;
}

.inline-progress .progress-container {
  margin: 0;
  background: transparent;
  padding: 0;
  width: 100%;
}

.inline-progress .progress-container progress {
  height: 16px;
  margin: 0;
}

.inline-progress .progress-container span {
  font-size: 12px;
  margin-left: 10px;
  white-space: nowrap;
}

/* Category Tree Styling */
.category-tree {
  list-style: none;
  padding-left: 0;
  margin: 20px 0;
}

.category-tree ul {
  list-style: none;
  padding-left: 30px;
  border-left: 1px solid var(--gray-300);
  margin: 5px 0 5px 7px;
}

.category-tree li {
  padding: 8px 12px;
  margin: 3px 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  position: relative;
}

.category-tree li:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tree-icon {
  margin-right: 12px;
  color: var(--primary);
  font-size: 14px;
  width: 12px;
  text-align: center;
  cursor: default;
}

.category-name {
  flex: 1;
  font-size: 14px;
  color: var(--gray-900);
  font-weight: 500;
}

.category-actions {
  display: flex;
  gap: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.category-tree li:hover .category-actions {
  opacity: 1;
}

.category-actions button {
  background: none;
  border: 1px solid transparent;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-actions button:hover {
  background: var(--primary-transparent);
  border-color: var(--primary-light);
}

.category-actions button:hover i.fa-edit {
  color: var(--primary-dark);
}

.category-actions button:hover i.fa-trash {
  color: var(--danger-dark);
}

.category-actions i {
  font-size: 14px;
}

.category-actions i.fa-edit {
  color: var(--primary);
}

.category-actions i.fa-trash {
  color: var(--danger);
}

/* Preview Modal Styles */
.preview-modal .modal-content {
  width: 90%;
  max-width: 1200px;
  height: 90vh;
  padding: 20px;
}

.preview-video {
  width: 100%;
  max-height: 70vh;
  margin: 20px 0;
}

.preview-pdf {
  width: 100%;
  height: 70vh;
  border: none;
  margin: 20px 0;
}

.video-info,
.pdf-info {
  margin-top: 20px;
  padding: 15px;
  background: var(--surface);
  border-radius: 4px;
}

/* Add these common styles near the top after :root */

/* Common Card Styles */
.content-card {
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: var(--white);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  height: auto;
  min-height: 100px;
  width: 100%;
  box-sizing: border-box;
}

.content-card .content-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.content-card .content-info h3 {
  font-size: 1rem;
  color: var(--gray-900);
  margin: 0 0 6px 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.content-card .content-info p {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.content-card:hover {
  background: var(--background);
}

.content-card.active {
  background: var(--primary-transparent);
  border-left: 3px solid var(--primary);
}

/* Common Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--background-light);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.timeline-wrapper {
  position: relative;
  padding: 20px 0;
  border-top: 4px solid var(--primary-dark);
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.timeline-item {
  position: relative;
  width: auto;
  padding: 15px;
  display: flex;
  flex-direction: row;
  align-items: center;
  cursor: pointer;
}

.timeline-item.left {
  inset-inline-start: 0;
  padding-inline-end: 1%;
  text-align: right;
  justify-content: flex-end;
}

.timeline-item.right {
  inset-inline-start: 50%;
  padding-inline-start: 1%;
  text-align: left;
  justify-content: flex-start;
}

.timeline-dot {
  position: absolute;
  width: 5px;
  height: 40px;
  background-color: var(--primary-dark);
  top: -24px;
  left: 140px;
  z-index: 2;
}

.timeline-item.left .timeline-dot {
  inset-inline-end: -8px;
}

.timeline-item.right .timeline-dot {
  inset-inline-start: -8px;
}

.section-header-books {
  line-height: normal;
  margin-bottom: -5px;
  /* text-decoration: underline; */
  text-decoration-color: var(--primary);
}

.section-header-books .section-title {
  margin-bottom: 0;
}

.timeline-content {
  width: 250px;
  height: 300px;
  background: #8fbc8f36;
  border: 2px solid var(--primary);
  padding: 20px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 5px #fff, 5px 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10%;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.timeline-item.left .timeline-content {
  border-radius: 30px 0 0 30px;
}

.timeline-item.right .timeline-content {
  border-radius: 0 30px 30px 0;
}

.timeline-thumbnail img {
  width: 100px;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
}

.timeline-thumbnail .default-thumbnail {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
}

/* .timeline-details {
  flex: 1;
} */

.pdf-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 5px;
}

.pdf-author {
  font-size: 14px;
  color: #555;
}

.pdf-description {
  font-size: 14px;
  color: #777;
  margin-top: 5px;
}

.no-books-message {
  text-align: center;
  font-size: 16px;
  color: #555;
}

@media (max-width: 1380px) {
  .timeline-wrapper {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .timeline-item {
    /* flex: 0 0 calc(50% - 20px); */
    margin-bottom: 10px;
  }
}


@media screen and (max-width: 768px) {
  .section-header-books {
    /* position: absolute;
    top: -2.3%;
    left: 22%; */
    text-decoration-color: var(--primary);
  }

  .timeline-item {
    width: 100%;
    flex-direction: column;
    text-align: ceter;
    align-items: center;
    padding: 15px 10px;
    position: relative;
  }

  .timeline-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
    background: #f0f8e8fc;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    margin: auto;
    border: 3px solid var(--primary);
    height: 265px;
  }

  .timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  }

  .timeline-thumbnail {
    overflow: hidden;
  }

  .timeline-thumbnail img,
  .timeline-thumbnail .default-thumbnail {
    /* width: 60%; */
    /* height: auto; */
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    border-radius: 8px;
    margin: auto;
  }

  .timeline-details {
    text-align: center;
  }

  .pdf-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
  }

  .pdf-author {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
  }

  .pdf-description {
    font-size: 14px;
    color: #555;
    margin-top: 5px;
  }

  .no-books-message {
    padding: 20px;
    font-size: 16px;
    color: #777;
  }
  /* .timeline-wrapper:before {
    content: "";
    position: absolute;
    width: 2px;
    background-color: var(--primary-dark);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
    z-index: 1;
  } */
}

/* Global Scrollbar Styling */
* {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--primary) var(--gray-200); /* Firefox */
}

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px; /* vertical scrollbar width */
  height: 8px; /* horizontal scrollbar height */
}

::-webkit-scrollbar-track {
  background: var(--gray-200);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

.hide-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

.hadees-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  margin: 20px 10px;
  padding-top: 50px;
}

.hadees-content p,
.hadees-content h2 {
  color: #b2a51f;
}

.hadees-content .arabic-text {
  direction: rtl;
  /* font-family: "Amiri", serif; */
}

.hadees-content .urdu-text {
  direction: rtl;
  /* font-family: "Jameel Noori Nastaleeq", "Nafees", serif; */
}

.hadees-description {
  display: flex;
  font-size: 1rem;
}

.hadees-content .reference {
  font-style: italic;
  color: #b2a51f;
  margin-top: 10px;
}

.no-data-message {
  text-align: center;
  padding: 20px;
  color: var(--gray-600);
  font-style: italic;
}

.fa-star.active {
  color: #ffc107 !important;
}

.btn-action .fa-star {
  transition: color 0.3s ease;
}

.btn-action:hover .fa-star {
  transform: scale(1.1);
}

/* PDF Modal Styles to match books timeline */
#pdfModal .modal-content {
  background: var(--white);
  border: 3px solid var(--primary);
  border-radius: 15px;
  padding: 20px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

#pdfModal .pdf-container {
  background: var(--white);
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#pdfModal .pdf-controls.timeline-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 10px;
  background: var(--white);
  border-radius: 8px;
}

#pdfModal .pdf-controls button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#pdfModal .pdf-controls button:hover {
  background: var(--primary-dark);
}

#pdfModal .pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pdfModal #pdfTitle {
  color: var(--primary);
  margin-bottom: 0;
  text-align: center;
}

/* Settings Panel Styles */
.settings-panel {
  background: var(--white);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.settings-grid {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-weight: 500;
  color: var(--gray-800);
}

.setting-item input {
  padding: 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 1rem;
}

.setting-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

#typing-container {
  font-family: "Amiri", Arial, sans-serif;
  font-size: 3rem;
  color: var(--primary-light);
  direction: rtl;
  text-align: center;
}
.video-info-display {
  padding: 10px 20px !important;
  background: var(--primary-transparent) !important;
  color: var(--text-color);
  border-radius: 0 0 8px 8px;
}

.video-info-display h2 {
  margin: 0 !important;
  font-size: 1.5rem;
  color: #476752ad !important;
}

.video-info-display p {
  margin: 0;
  font-size: 1rem;
  color: #476752e3 !important;
  line-height: 1.5;
}

.intro-under-video {
  padding: 20px;
  font-weight: bold;
  margin: 10px 0px 0px;
  background: var(--primary-transparent) !important;
  color: #476752ad !important;
}

.daily-verse-section {
  display: block;
  /* grid-template-columns: repeat(2, 1fr); */
  gap: 0;
  padding-block: 0;
  padding-inline: 0;
  /* background-image: url(/assets/masjid-nabwi-bg.png);
  background-size: inherit;
  background-position-y: 100%;
  background-position-x: 100%; */
}

@media screen and (max-width: 768px) {
  .daily-verse-section {
    grid-template-columns: 1fr;
    padding-inline: 0;
    background-size: cover;
    background-position-y: 0%;
    background-position-x: 60%;
  }
}
.hero-banner .row {
  display: flex;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

.hero-banner .card-body {
  flex: 1 0 48%;
  min-width: 300px;
  padding: 0;
  margin: 0;
}

.ratio-16x9 {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.ratio-16x9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .hero-banner .row {
    flex-direction: column-reverse;
  }

  .hero-banner .card-body {
    flex-basis: 100%;
    min-width: unset;
  }
}

.category-item {
  position: relative;
}
.tooltip {
  display: none;
  z-index: 1000;
  position: absolute;
  right: -75px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

.sidemenu.collapsed .category-item:hover .tooltip,
.sidemenu.collapsed .back-to-english:hover .tooltip {
  display: block;
}

.sidemenu.collapsed .sidemenu-content {
  overflow: visible;
}

.nested-category .tooltip {
  display: none !important;
}
.pdf-thumbnail {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f9fa;
  color: #dc3545;
  height: 100%;
  font-size: 2rem;
}

#pdfContainer {
  width: 100%;
}

/* Font fallbacks for each language/script type */
.arabic-text,
[lang="ar"] {
  font-family: "Amiri", "Traditional Arabic", "Arabic Typesetting",
    "Simplified Arabic", "Al Bayan", "Scheherazade", serif;
}

[lang="ur"],
.urdu-text {
  font-family: "Noto Nastaliq Urdu", "Urdu Typesetting",
    "Jameel Noori Nastaleeq", "Nafees", "Nastalliq", serif;
}

.english-text,
[lang="en"] {
  font-family: "Roboto", "Segoe UI", "Arial", "Helvetica", sans-serif;
}

/* We removed references to Nafees Web Naskh as we've moved to Google Fonts */
/* This is kept for backward compatibility with existing content */
.urdu-text[data-font="Nafees Web Naskh"],
[lang="ur"][data-font="Nafees Web Naskh"] {
  font-family: var(--font-noto-tajawal) !important;
}

.urdu-text[data-font="Tajawal"],
[lang="ur"][data-font="Tajawal"] {
  font-family: var(--font-noto-tajawal) !important;
}

.export-btn {
  background: var(--primary);
  padding: 12px;
  color: white;
  font-size: 18px;
  border-radius: 20px;
  border: 2px solid var(--primary-light);
}
