/* Teachings Section Variables and Base Styles */
:root {
  --teachings-primary-blue: #1e40af;
  --teachings-light-blue: #3b82f6;
  --teachings-accent-gold: #d4af37;
  --teachings-text-dark: #000000;
  --teachings-text-light: #64748b;
  --teachings-bg-light: #f8fafc;
}

/* Teachings Section Base */
.teachings-carousel-section {
  padding: 40px 0;
  background: #ffffff;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

/* Header Section */
.teachings-header {
  /* max-width: 1400px; */
  margin: 0 auto 50px;
  padding: 0 40px;
}

.teachings-label {
  font-size: 0.813rem;
  font-weight: 600;
  color: var(--teachings-accent-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  display: inline-block;
}

.teachings-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--teachings-text-dark);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  line-height: 1.1;
}

.teachings-description {
  font-size: 1.125rem;
  color: var(--teachings-text-light);
  line-height: 1.6;
  max-width: 600px;
}

/* Carousel Wrapper */
.teachings-carousel-wrapper {
  position: relative;
  /* max-width: 1400px; */
  margin: 0 auto;
  padding: 0 40px;
}

/* Carousel Container */
.teachings-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 20px 0 40px;
  cursor: grab;
  user-select: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.teachings-carousel::-webkit-scrollbar {
  display: none;
}

.teachings-carousel:active {
  cursor: grabbing;
}

/* Video Card */
.teaching-card {
  flex: 0 0 auto;
  width: 380px;
  scroll-snap-align: start;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.teaching-card:hover {
  transform: scale(1.05);
  z-index: 10;
}

/* Thumbnail Container */
.teaching-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--teachings-bg-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.teaching-card:hover .teaching-thumbnail {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.teaching-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.teaching-card:hover .teaching-thumbnail img {
  transform: scale(1.08);
}

/* Play Overlay */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.teaching-card:hover .play-overlay {
  opacity: 1;
}

.play-button {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teachings-primary-blue);
  font-size: 1.5rem;
  transform: scale(0.9);
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.teaching-card:hover .play-button {
  transform: scale(1);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Badges */
.teaching-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-new {
  background: linear-gradient(
    135deg,
    var(--teachings-primary-blue),
    var(--teachings-light-blue)
  );
  color: white;
}

.badge-duration {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  margin-left: auto;
}

/* Card Content */
.teaching-content {
  padding: 16px 0;
}

.teaching-category {
  font-size: 0.813rem;
  color: var(--teachings-accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.teaching-title-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--teachings-text-dark);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.teaching-meta {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--teachings-text-light);
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-item i {
  font-size: 0.813rem;
  color: var(--teachings-accent-gold);
}

/* Navigation Arrows */
.teachings-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.teachings-carousel-wrapper:hover .teachings-nav {
  opacity: 1;
}

.teachings-nav.disabled {
  opacity: 0.3 !important;
  pointer-events: none;
}

.teachings-nav-prev {
  left: 0;
}

.teachings-nav-next {
  right: 0;
}

.nav-button {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--teachings-text-dark);
  font-size: 1.125rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
  background: var(--teachings-accent-gold);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(212, 175, 55, 0.4);
}

/* Progress Dots */
.teachings-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  background: rgba(30, 64, 175, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot:hover {
  background: rgba(30, 64, 175, 0.4);
}

.dot.active {
  width: 24px;
  border-radius: 4px;
  background: linear-gradient(
    135deg,
    var(--teachings-primary-blue),
    var(--teachings-accent-gold)
  );
}

/* View All Button */
.view-all-container {
  text-align: center;
  margin-top: 50px;
}

.view-all-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: white;
  color: var(--teachings-primary-blue);
  border: 2px solid var(--teachings-accent-gold);
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
}

.view-all-button:hover {
  background: var(--teachings-accent-gold);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.3);
}

.view-all-button i {
  transition: transform 0.3s ease;
}

.view-all-button:hover i {
  transform: translateX(4px);
}

/* Loading State */
.skeleton-card {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 16px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .teaching-card {
    width: 340px;
  }
}

@media (max-width: 768px) {
  .teachings-carousel-section {
    padding: 60px 0;
  }

  .teachings-header,
  .teachings-carousel-wrapper {
    padding: 0 20px;
  }

  .teaching-card {
    width: 300px;
  }

  .teachings-nav {
    display: none;
  }

  .teachings-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .teaching-card {
    width: 280px;
  }

  .play-button {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
  }
}

/* Smooth scroll for better UX */
@media (prefers-reduced-motion: no-preference) {
  .teachings-carousel {
    scroll-behavior: smooth;
  }
}

/* Apple-style modal specific to teachings section */
.teachings-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.teachings-video-modal.active {
  opacity: 1;
}

.teachings-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.teachings-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.teachings-video-modal.active .teachings-modal-content {
  transform: scale(1);
  opacity: 1;
}

.teachings-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
}

.teachings-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.teachings-modal-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
}

.teachings-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background-color 0.2s ease;
  z-index: 1;
}

.teachings-modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.teachings-modal-close svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.teachings-modal-close:hover svg {
  transform: scale(1.1);
}

/* Loading state styles */
.teachings-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: #fff;
  animation: teachings-spin 1s linear infinite;
}

@keyframes teachings-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .teachings-modal-content {
    width: 95%;
  }

  .teachings-modal-title {
    font-size: 1.2rem;
    padding: 1rem;
  }

  .teachings-modal-close {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }
}
