/**
 * Shared Carousel Styles
 * Used by both Teaching and Healing carousels for consistency
 */

/* ========================================
   CAROUSEL WRAPPER
   ======================================== */
.teachings-carousel-wrapper,
.healing-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

/* ========================================
   CAROUSEL CONTAINERS
   ======================================== */
.teachings-carousel,
.healing-carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 8px 0 20px; /* Extra padding for shadows */
}

.teachings-carousel::-webkit-scrollbar,
.healing-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ========================================
   NAVIGATION BUTTONS
   ======================================== */
.teachings-nav,
.healing-nav {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background 0.3s ease;
    z-index: 10;
    flex-shrink: 0;
}

.teachings-nav:hover,
.healing-nav:hover {
    background: #ffffff;
}

.teachings-nav:active,
.healing-nav:active {
    background: #ffffff;
}

.teachings-nav.disabled,
.healing-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nav-button i {
    color: #1c1c1e;
    font-size: 18px;
}

/* ========================================
   PROGRESS BAR (Replaces Dots)
   ======================================== */
.carousel-progress-container {
    width: 100%;
    max-width: 500px;
    height: 4px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 24px auto 0;
    position: relative;
}

.carousel-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

/* Animated shimmer effect on progress bar */
.carousel-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ========================================
   CARD STYLES (Shared)
   ======================================== */
.teaching-card,
.healing-card {
    flex: 0 0 auto;
    width: 380px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    scroll-snap-align: start;
}

.teaching-card:hover,
.healing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.teaching-thumbnail,
.healing-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

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

.teaching-card:hover .teaching-thumbnail img,
.healing-card:hover .healing-thumbnail img {
    transform: scale(1.05);
}

/* ========================================
   PLAY OVERLAY
   ======================================== */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.teaching-card:hover .play-overlay,
.healing-card:hover .play-overlay {
    background: rgba(0, 0, 0, 0.3);
}

.play-button {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.teaching-card:hover .play-button,
.healing-card:hover .play-button {
    opacity: 1;
    transform: scale(1);
}

.play-button i {
    font-size: 24px;
    color: #1c1c1e;
}

/* ========================================
   BADGES
   ======================================== */
.teaching-badges,
.healing-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    flex-direction: column;
    align-items: flex-end;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.badge-new {
    background: rgba(255, 59, 48, 0.9);
    color: white;
}

.badge-duration {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}

/* ========================================
   CARD CONTENT
   ======================================== */
.teaching-content,
.healing-content {
    padding: 20px;
}

.teaching-category,
.healing-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #764ba2;
    margin-bottom: 8px;
}

.teaching-title-text,
.healing-title-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #1c1c1e;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .teaching-card,
    .healing-card {
        width: 340px;
    }
}

@media (max-width: 768px) {
    .teachings-carousel-wrapper,
    .healing-carousel-wrapper {
        gap: 12px;
        margin: 30px 0;
    }

    .teaching-card,
    .healing-card {
        width: 300px;
    }

    .teachings-nav,
    .healing-nav {
        width: 40px;
        height: 40px;
    }

    .nav-button i {
        font-size: 16px;
    }

    .carousel-progress-container {
        max-width: 100%;
        margin: 20px auto 0;
    }
}

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

    .teachings-nav,
    .healing-nav {
        width: 36px;
        height: 36px;
        display: none; /* Hide on very small screens */
    }

    .teaching-content,
    .healing-content {
        padding: 16px;
    }

    .teaching-title-text,
    .healing-title-text {
        font-size: 14px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.teachings-nav:focus-visible,
.healing-nav:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .teachings-carousel,
    .healing-carousel {
        scroll-behavior: auto;
    }

    .teaching-card,
    .healing-card,
    .teachings-nav,
    .healing-nav,
    .carousel-progress-bar {
        transition: none;
    }

    .carousel-progress-bar::after {
        animation: none;
    }
}
