/**
 * Category Carousel Styles
 * Styles for the category carousel on frontend
 *
 * @package Tao_Connect
 * @since 1.0.0
 */

.category-carousel {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background: #f5f5f5;
}

.carousel-slides-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 40%; /* 2.5:1 aspect ratio */
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.carousel-nav:focus {
    outline: 2px solid #0D47A1;
    outline-offset: 2px;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-nav .tao-icon {
    font-size: 24px;
    color: #333;
}

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

.carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.carousel-indicator.active {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .carousel-slides-container {
        padding-bottom: 50%; /* Taller on mobile */
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .carousel-nav .tao-icon {
        font-size: 20px;
    }

    .carousel-indicators {
        bottom: 15px;
        gap: 6px;
    }

    .carousel-indicator {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .carousel-slides-container {
        padding-bottom: 60%; /* Even taller on small mobile */
    }

    .carousel-nav {
        width: 36px;
        height: 36px;
    }

    .carousel-prev {
        left: 5px;
    }

    .carousel-next {
        right: 5px;
    }

    .carousel-indicators {
        bottom: 10px;
        gap: 5px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
    }
}

/* Dark mode support */
.dark .category-carousel {
    background: #1a1a1a;
}

.dark .carousel-nav {
    background: rgba(0, 0, 0, 0.6);
}

.dark .carousel-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.dark .carousel-nav .tao-icon {
    color: #fff;
}

.dark .carousel-indicator {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.dark .carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.5);
}

.dark .carousel-indicator.active {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 1);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .carousel-slide {
        transition: none;
    }

    .carousel-nav,
    .carousel-indicator {
        transition: none;
    }
}

/* Loading state */
.category-carousel.loading {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-carousel.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0D47A1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

