/* ========================================
   WEBINAR VIDEO LIBRARY STYLES
   ======================================== */

.webinar-video-library {
  font-family: 'Montserrat', Arial, sans-serif;
  padding: 40px 0;
}

/* Library Header */
.video-library-header {
  text-align: center;
  margin-bottom: 50px;
}

.library-title {
  font-size: 36px;
  font-weight: 700;
  color: #192236;
  margin: 0 0 20px 0;
  line-height: 1.2;
}

.library-description {
  font-size: 18px;
  color: #666;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Video Accordion Grid */
.video-accordion-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}

/* Grid columns based on data attribute */
.video-accordion-grid[data-columns="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.video-accordion-grid[data-columns="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.video-accordion-grid[data-columns="4"] {
  grid-template-columns: repeat(4, 1fr);
}

/* Accordion Item */
.video-accordion-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.video-accordion-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-accordion-item.featured {
  border-color: #4FF7D7;
  border-width: 2px;
}

/* Accordion Header */
.accordion-header {
  cursor: pointer;
  padding: 20px;
  background: #fff;
  transition: background 0.3s ease;
  user-select: none;
}

.accordion-header:hover {
  background: #f9f9f9;
}

.video-accordion-item.active .accordion-header {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.accordion-header-content {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

/* Video Icon */
.video-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #006C7F;
  border-radius: 50%;
  color: white;
}

.video-accordion-item.active .video-icon {
  background: #4FF7D7;
  color: #006C7F;
}

/* Video Meta */
.video-meta {
  flex: 1;
}

.video-title {
  font-size: 18px;
  font-weight: 700;
  color: #192236;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.video-info {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}

.video-category {
  background: #006C7F;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.video-duration,
.video-presenters {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Accordion Toggle Icon */
.accordion-toggle {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #006C7F;
  transition: transform 0.3s ease;
}

.icon-minus {
  display: none;
}

.video-accordion-item.active .icon-plus {
  display: none;
}

.video-accordion-item.active .icon-minus {
  display: block;
}

.video-accordion-item.active .accordion-toggle {
  transform: rotate(180deg);
}

/* Accordion Content */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.video-accordion-item.active .accordion-content {
  max-height: 1000px; /* Adjust based on content */
  transition: max-height 0.5s ease-in;
}

.accordion-content-inner {
  padding: 20px;
  background: #fafafa;
}

/* Video Wrapper & Embed */
.video-wrapper {
  margin-bottom: 15px;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Video Thumbnail (before loading iframe) */
.video-thumbnail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail:hover {
  opacity: 0.9;
}

.video-embed.loaded .video-thumbnail {
  display: none;
}

/* Play Button Overlay */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}

.video-thumbnail:hover .play-button {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video Description */
.video-description {
  margin-bottom: 10px;
}

.video-description p {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  margin: 0;
}

/* Video Date Info */
.video-date-info {
  font-size: 12px;
  color: #999;
}

/* No Videos Message */
.no-videos-message {
  text-align: center;
  padding: 60px 20px;
  background: #f5f5f5;
  border-radius: 8px;
}

.no-videos-message p {
  font-size: 16px;
  color: #666;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
  .video-accordion-grid[data-columns="3"],
  .video-accordion-grid[data-columns="4"] {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .library-title {
    font-size: 32px;
  }
}

@media (max-width: 768px) {
  .video-accordion-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
  }
  
  .library-title {
    font-size: 28px;
  }
  
  .library-description {
    font-size: 16px;
  }
  
  .accordion-header {
    padding: 15px;
  }
  
  .video-title {
    font-size: 16px;
  }
  
  .video-icon {
    width: 35px;
    height: 35px;
  }
  
  .video-info {
    flex-direction: column;
    gap: 8px;
  }
  
  .accordion-content-inner {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .webinar-video-library {
    padding: 20px 0;
  }
  
  .video-library-header {
    margin-bottom: 30px;
  }
  
  .library-title {
    font-size: 24px;
  }
  
  .library-description {
    font-size: 14px;
  }
  
  .accordion-header-content {
    gap: 10px;
  }
  
  .video-title {
    font-size: 15px;
  }
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.video-embed.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */

.video-load-more-container {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
}

.video-load-more-btn {
  background: #006C7F;
  color: #fff;
  border: none;
  padding: 16px 40px;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Montserrat', Arial, sans-serif;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 108, 127, 0.2);
}

.video-load-more-btn:hover {
  background: #005566;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 108, 127, 0.3);
}

.video-load-more-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 108, 127, 0.2);
}

.video-load-more-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.video-load-more-btn .btn-loader svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.video-count-info {
  margin-top: 15px;
  font-size: 14px;
  color: #666;
}

.video-count-info .current-count,
.video-count-info .total-count {
  font-weight: 600;
  color: #006C7F;
}
