/* Tensai Carousel */
.tsc-carousel-wrapper {
    position: relative;
    width: 100%;
}

.tsc-width-full .tsc-carousel-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.tsc-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

/* Auto height mode - follow image aspect ratio */
.tsc-carousel-container.tsc-height-auto {
    height: auto !important;
}

.tsc-carousel-container.tsc-height-auto .swiper {
    height: auto;
}

.tsc-carousel-container.tsc-height-auto .swiper-wrapper {
    height: auto;
}

.tsc-carousel-container.tsc-height-auto .swiper-slide {
    height: auto;
    display: block; /* Override flex to remove centering */
}

.tsc-carousel-container.tsc-height-auto .tsc-slide-image {
    height: auto;
    width: 100%;
    display: block;
    object-fit: contain; /* Use contain for auto mode to prevent crop */
}

.tsc-carousel-container.tsc-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: #000;
}

.tsc-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}

.tsc-fullscreen-btn:hover {
    background: #fff;
}

.tsc-carousel-container .swiper {
    width: 100%;
    height: 100%;
}


/* Slides */
.tsc-carousel-container .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fff;
    min-height: 100%; /* Ensure slide takes full container height */
}

/* Fixed height mode - ensure proper stretching */
.tsc-carousel-container.tsc-height-fixed .swiper-slide {
    height: 100%;
}

/* Images - responsive and contained */
.tsc-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content overlay */
.tsc-slide-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: #fff;
    z-index: 10;
    padding: 15px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
}

.tsc-slide-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Navigation - simple and clean */
.tsc-carousel-container .swiper-button-next,
.tsc-carousel-container .swiper-button-prev {
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: opacity 0.3s;
}

.tsc-carousel-container .swiper-button-next:hover,
.tsc-carousel-container .swiper-button-prev:hover {
    opacity: 0.8;
}

.tsc-carousel-container .swiper-button-next:after,
.tsc-carousel-container .swiper-button-prev:after {
    font-size: 20px;
    font-weight: bold;
}

/* Pagination - clean dots */
.tsc-carousel-container .swiper-pagination {
    bottom: 15px;
}

.tsc-carousel-container .swiper-pagination-bullet {
    background: #333;
    opacity: 0.3;
    width: 8px;
    height: 8px;
    margin: 0 4px;
}

.tsc-carousel-container .swiper-pagination-bullet-active {
    opacity: 1;
}

/* Fraction pagination */
.tsc-carousel-container .swiper-pagination-fraction {
    color: #333;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 20px;
    width: auto;
    bottom: 15px;
}

/* Progress bar pagination */
.tsc-carousel-container .swiper-pagination-progressbar {
    background: rgba(0, 0, 0, 0.1);
    height: 4px;
}

.tsc-carousel-container .swiper-pagination-progressbar-fill {
    background: #333;
}

/* Responsive - mobile friendly */
@media (max-width: 768px) {
    .tsc-carousel-container .swiper-button-next,
    .tsc-carousel-container .swiper-button-prev {
        width: 36px;
        height: 36px;
    }
    
    .tsc-carousel-container .swiper-button-next:after,
    .tsc-carousel-container .swiper-button-prev:after {
        font-size: 16px;
    }
    
    .tsc-slide-content {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
    }
    
    .tsc-slide-title {
        font-size: 16px;
    }
}

/* Touch devices */
@media (pointer: coarse) {
    .tsc-carousel-container {
        touch-action: pan-y pinch-zoom;
    }
}

/* RTL support */
.rtl .tsc-carousel-container .swiper-button-next {
    left: 10px;
    right: auto;
}

.rtl .tsc-carousel-container .swiper-button-prev {
    right: 10px;
    left: auto;
}

/* Elementor editor compatibility */
.elementor-editor-active .tsc-carousel-container {
    min-height: 200px;
}

/* Loading state */
.tsc-carousel-container.is-loading {
    background: #f0f0f0;
    position: relative;
}

.tsc-carousel-container.is-loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: tsc-spin 1s linear infinite;
}

@keyframes tsc-spin {
    to { transform: rotate(360deg); }
}
