/* Video layout styling */
.content-container-lectures {
  display: grid;
  grid-template-columns: 75% 25%;
  gap: 20px;
  padding: 20px;
  height: auto !important;
  overflow: hidden;
}

/* Shared list container styles */
.video-flex,
.content-flex {
  @extend .custom-scrollbar;
  display: flex;
  flex-direction: column;
  max-height: 815px;
  min-height: -webkit-fill-available;
  overflow-y: auto;
  padding: 15px;
  background: var(--white);
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Shared card styles */
.video-flex .video-card,
.content-flex .pdf-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;
}

/* Shared card info styles */
.video-flex .video-info,
.content-flex .pdf-card .content-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

/* Shared heading styles */
.video-flex .video-info h3,
.content-flex .pdf-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;
}

/* Shared description styles */
.video-flex .video-info p,
.content-flex .pdf-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;
}

/* Shared active and hover states */
.video-flex .video-card.active,
.content-flex .pdf-card.active {
  background: var(--primary-transparent);
  border-left: 3px solid var(--primary);
}

.video-flex .video-card:hover,
.content-flex .pdf-card:hover {
  background: var(--background);
}

/* Video specific styles */
.video-flex .video-thumbnail {
  position: relative;
  width: 100px;
  min-width: 100px;
  height: 70px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--background);
  padding-top: 0;
}

.video-flex .video-thumbnail img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: none !important;
  border-radius: 4px;
}

.video-flex .default-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
}

.video-flex .default-thumbnail i {
  font-size: 1.5rem;
  color: var(--gray-400);
}

#videoPlayerContainer {
  width: 100%;
  background: var(--background-dark);
  border-radius: 8px;
  overflow: hidden;
  height: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

#videoPlayerContainer video {
  flex: 0 1 auto;
  min-height: 0;
}

#mainVideoPlayer {
  width: 100%;
  flex: 1;
  background: black;
  min-height: 300px;
}

/* Overlay styling */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Popup styling */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--white, #fff);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  text-align: center;
  min-height: 100px;
  width: 320px;
  display: none;
}

.popup.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.popup p {
  font-size: 1.1em;
  margin-bottom: 20px;
  color: var(--gray-900, #333);
  line-height: 1.4;
}

/* Timer styling */
#countdown-timer {
  font-weight: bold;
  font-size: 1.2em;
  color: var(--primary, #4caf50);
}

/* Button styling */
.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.popup button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  min-width: 100px;
  position: relative;
  z-index: 1001;
}

/* Primary action button (Yes, Next) */
.popup button,
.next-btn {
  background-color: var(--primary);
  color: white;
}

.popup button:hover,
.next-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

/* Secondary action button (Cancel) */
.cancel-btn {
  background-color: var(--gray-200, #e0e0e0) !important;
  color: var(--gray-800, #333) !important;
}

.cancel-btn:hover {
  background-color: var(--gray-300, #d0d0d0) !important;
}

/* Add responsive adjustments */
@media screen and (max-width: 1200px) {
  .content-container-lectures {
    grid-template-columns: 70% 30%;
  }
}

@media screen and (max-width: 768px) {
  .content-container-lectures {
    grid-template-columns: 1fr;
    height: 100vh;
    overflow: hidden;
    flex-direction: column;
  }

  .video-flex,
  .content-flex {
    max-height: 400px;
    overflow-y: auto;
  }

  #mainPdfContainer {
    min-height: 60vh;
  }
}

/* Update the video info display styles */
.video-info-display {
  padding: 10px 20px !important;
  background: var(--primary-transparent) !important;
  color: var(--text-color) !important;
  border-radius: 0 0 8px 8px;
}

.video-info-display h2 {
  margin: 0px !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;
}

/* Force video controls to always show on larger screens */
@media screen and (min-width: 768px) {
  #mainVideoPlayer::-webkit-media-controls {
    opacity: 1 !important;
    display: flex !important;
  }

  #mainVideoPlayer::-webkit-media-controls-panel {
    display: flex !important;
  }
}

/* Add these styles for PDF viewer */
#pdfViewerContainer {
  width: 100%;
  flex: 1;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
  display: flex;
  flex-direction: column;
}

#pdfViewer {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  border: none;
  background: white;
  pointer-events: auto;
  position: relative;
}

/* Prevent text selection in PDF viewer */
#pdfViewer canvas {
  pointer-events: none;
}

/* PDF viewer layout */
#mainPdfContainer {
  width: 100%;
  background: var(--background-dark);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pdf-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-info {
  padding: 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.pdf-info h2 {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  color: var(--gray-900);
}

.pdf-info p {
  margin: 0;
  font-size: 1rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Video player user selection prevention */
#lecturePlayer {
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide download button if it exists */
#lecturePlayer .vjs-download-button {
  display: none !important;
}

/* Prevent text selection on video */
#lecturePlayer::selection {
  background: transparent;
}

/* Next video countdown styles */
#next-video-countdown {
  text-align: center;
  min-width: 300px;
}

#next-video-countdown button {
  margin-top: 10px;
  padding: 8px 15px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#next-video-countdown button:hover {
  background-color: var(--primary-dark);
}

/* Updated disabled state styling */
.video-card.disabled {
  position: relative;
  cursor: not-allowed;
  box-shadow: none;
}

/* Hide lock overlay by default */
.video-lock-overlay {
  display: none; /* Hidden by default */
}

/* Only show lock overlay when video card is disabled */
.video-card.disabled .video-lock-overlay {
  display: flex; /* Show when parent has disabled class */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 5;
  border-radius: 12px;
}

.video-card.disabled .video-lock-overlay i {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8); /* Light lock icon */
}

/* Clean completed state with single indicator */
.video-card.completed {
  border-left: 3px solid var(--primary);
}

/* Remove the custom indicator styling since we're using ::after */
.video-card .completed-indicator {
  display: none;
}

/* Ensure the CSS ::after pseudo-element has a high z-index */
.video-card.completed::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 10; /* Higher z-index to ensure visibility */
  transform: translate(50%, -50%);
}

/* Add these styles to css/lectures.css */
.video-info {
  padding: 10px;
  text-align: left;
}

.video-info h3 {
  font-size: 14px;
  margin: 0 0 5px 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-info p {
  font-size: 12px;
  margin: 0;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.video-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  cursor: pointer;
  width: 230px;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.video-thumbnail {
  width: 100%;
  height: 130px;
  overflow: hidden;
  position: relative;
}

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

.default-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
}

.default-thumbnail i {
  font-size: 36px;
  color: #999;
}

/* Fix the video card layout in the flex container */
.video-flex {
  /* Revert to original styles */
}

/* Ensure video cards have a consistent width and display properly */
.video-flex .video-card {
  /* Revert to original styles */
}

/* Make sure descriptions are visible in the cards */
.video-flex .video-info p {
  /* Revert to original styles */
}

/* Ensure proper spacing in the info box */
.video-flex .video-info {
  /* Revert to original styles */
}

/* Style for empty descriptions */
.video-info .no-description {
  font-style: italic;
  color: #999;
}
