/* Custom Slider CSS - Enhanced Version */

.custom-slider {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
    min-height: 200px;
    min-width: 200px;
}

/* Ensure all containers have proper height for image sizing to work */
.slider-container,
.slides-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    min-height: inherit;
}

.slides-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: inherit;
}

.custom-slider[data-animation-type="fade"] .slides-wrapper {
    display: block;
}

.custom-slider[data-animation-type="none"] .slides-wrapper {
    transition: none;
}

.slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease;
    cursor: pointer;
    min-height: inherit;
    overflow: hidden;
}

/* Ensure proper container setup for different image size modes */
.custom-slider[data-image-size-mode="actualSizeOfFit"] .slide {
    overflow: visible;
}

.custom-slider[data-image-size-mode="fillAndCrop"] .slide {
    overflow: hidden;
}

.custom-slider[data-animation-type="fade"] .slide {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.custom-slider[data-animation-type="fade"] .slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    display: block;
    transition: transform 0.3s ease;
}

/* Default image sizing - FitProportional */
.slide img,
.custom-slider[data-image-size-mode="fitProportional"] .slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ActualSizeOfFit - Show image at actual size or fit to container */
.custom-slider[data-image-size-mode="actualSizeOfFit"] .slide img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: none;
}

/* FillAndCrop - Fill container completely and crop excess */
.custom-slider[data-image-size-mode="fillAndCrop"] .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.slide:hover img {
    transform: scale(1.02);
}

.slide a {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Loading states for different image load modes */
.slide.loading {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px;
    text-align: center;
}

.slide-caption.none {
    display: none;
}

.slide-caption.always {
    opacity: 1;
}

.slide-caption.faded {
    opacity: 0.5;
}

.slide-caption.onMouseOver {
    opacity: 0;
    transition: opacity 0.3s;
}

.slide:hover .slide-caption.onMouseOver {
    opacity: 1;
}

/* Horizontal positioning for slide content */
.slide-content.horizontal-left {
    justify-content: flex-start;
    text-align: left;
}

.slide-content.horizontal-center {
    justify-content: center;
    text-align: center;
}

.slide-content.horizontal-right {
    justify-content: flex-end;
    text-align: right;
}

/* Vertical positioning for slide content */
.slide-content.vertical-top {
    align-items: flex-start;
}

.slide-content.vertical-middle {
    align-items: center;
}

.slide-content.vertical-bottom {
    align-items: flex-end;
}

/* Combined positioning classes */
.slide-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    pointer-events: none;
}

.slide-content > * {
    pointer-events: auto;
}

/* Navigation Buttons - Enhanced */
.slider-nav-buttons {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 10;
    pointer-events: none;
}

.slider-nav-buttons button {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8));
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    font-size: 16px;
}

.slider-nav-buttons button:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.slider-nav-buttons button:active {
    transform: scale(0.95);
}

.slider-nav-buttons.none {
    display: none;
}

.slider-nav-buttons.always {
    opacity: 1;
}

.slider-nav-buttons.faded {
    opacity: 0.6;
}

.slider-nav-buttons.onMouseOver {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-slider:hover .slider-nav-buttons.onMouseOver {
    opacity: 1;
}

/* Vertical navigation adjustments */
.custom-slider[data-direction="vertical"] .slider-nav-buttons {
    flex-direction: column;
    height: 100%;
    width: auto;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    justify-content: space-between;
    padding: 15px 0;
}

/* Navigation Bar */
.slider-nav-bar {
    position: absolute;
    z-index: 10;
    display: flex;
}

.slider-nav-bar.bottom {
    bottom: 10px;
    left: 0;
    right: 0;
    justify-content: center;
}

.slider-nav-bar.top {
    top: 10px;
    left: 0;
    right: 0;
    justify-content: center;
}

.slider-nav-bar.left {
    left: 10px;
    top: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
}

.slider-nav-bar.right {
    right: 10px;
    top: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
}

/* Dots */
.dots-container {
    display: flex;
    gap: 5px;
}

.slider-nav-bar.left .dots-container,
.slider-nav-bar.right .dots-container {
    flex-direction: column;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.dot.active {
    background-color: white;
}

/* Thumbnails - Enhanced */
.thumbnails-container {
    display: flex;
    gap: 8px;
    align-items: center;
    max-width: 85%;
    overflow: hidden;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.slider-nav-bar.left .thumbnails-container,
.slider-nav-bar.right .thumbnails-container {
    flex-direction: column;
    max-width: 100%;
    max-height: 85%;
}

.thumbnails-wrapper {
    display: flex;
    gap: 8px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.slider-nav-bar.left .thumbnails-wrapper,
.slider-nav-bar.right .thumbnails-wrapper {
    flex-direction: column;
}

.thumbnail {
    width: 70px;
    height: 50px;
    cursor: pointer;
    border: 3px solid transparent;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
}

.thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s;
    z-index: 1;
}

.thumbnail.active {
    border-color: #007bff;
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.thumbnail.active::before {
    opacity: 0;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.02);
}

.thumbnail:hover::before {
    opacity: 0;
}

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

.thumbnail:hover img {
    transform: scale(1.1);
}

/* Thumbnail navigation buttons */
.thumb-prev, 
.thumb-next {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb-prev:hover, 
.thumb-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.thumb-prev.none,
.thumb-next.none {
    display: none;
}

.thumb-prev.always,
.thumb-next.always {
    opacity: 1;
}

.thumb-prev.faded,
.thumb-next.faded {
    opacity: 0.5;
}

.thumb-prev.onMouseOver,
.thumb-next.onMouseOver {
    opacity: 0;
    transition: opacity 0.3s;
}

.thumbnails-container:hover .thumb-prev.onMouseOver,
.thumbnails-container:hover .thumb-next.onMouseOver {
    opacity: 1;
}

/* Play/Pause button */
.slider-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 10;
}

.play-pause-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-pause-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slider-controls.none {
    display: none;
}

.slider-controls.always {
    opacity: 1;
}

.slider-controls.faded {
    opacity: 0.5;
}

.slider-controls.onMouseOver {
    opacity: 0;
    transition: opacity 0.3s;
}

.custom-slider:hover .slider-controls.onMouseOver {
    opacity: 1;
}

/* Vertical orientation */
.custom-slider[data-direction="vertical"] .slides-wrapper {
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 768px) {
    .slider-nav-buttons button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .thumbnail {
        width: 50px;
        height: 35px;
    }
    
    .thumbnails-container {
        max-width: 95%;
        gap: 5px;
        padding: 5px;
    }
    
    .slide-caption {
        font-size: 14px;
        padding: 8px;
    }
    
    .play-pause-btn {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .slider-nav-buttons {
        padding: 0 8px;
    }
    
    .slider-nav-buttons button {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .thumbnail {
        width: 40px;
        height: 28px;
    }
    
    .thumbnails-container {
        gap: 3px;
        padding: 3px;
    }
    
    .slide-caption {
        font-size: 12px;
        padding: 5px;
    }
}

/* Enhanced animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Performance optimizations */
.custom-slider {
    will-change: transform;
    transform: translateZ(0);
}

.slides-wrapper {
    will-change: transform;
    transform: translateZ(0);
}

.slide {
    will-change: opacity, transform;
    transform: translateZ(0);
}

/* Accessibility improvements */
.slider-nav-buttons button:focus,
.dot:focus,
.thumbnail:focus,
.play-pause-btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Debug styles removed - clean production version */

/* Slide content positioning */
.slide[data-horizontal-position="left"] {
    justify-content: flex-start;
}

.slide[data-horizontal-position="center"] {
    justify-content: center;
}

.slide[data-horizontal-position="right"] {
    justify-content: flex-end;
}

.slide[data-vertical-position="top"] {
    align-items: flex-start;
}

.slide[data-vertical-position="middle"] {
    align-items: center;
}

.slide[data-vertical-position="bottom"] {
    align-items: flex-end;
}

/* Slide caption positioning based on slide positioning */
.slide[data-vertical-position="top"] .slide-caption {
    bottom: auto;
    top: 0;
}

.slide[data-vertical-position="middle"] .slide-caption {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
}

.slide[data-horizontal-position="left"] .slide-caption {
    text-align: left;
}

.slide[data-horizontal-position="center"] .slide-caption {
    text-align: center;
}

.slide[data-horizontal-position="right"] {
    text-align: right;
}

/* Item text visibility handling */
.slide-caption.none {
    display: none;
}

.slide-caption.always {
    opacity: 1;
}

.slide-caption.faded {
    opacity: 0.7;
}

.slide-caption.onMouseOver {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slide:hover .slide-caption.onMouseOver {
    opacity: 1;
}

/* Custom utility classes */
.d-none {
    display: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .slider-nav-buttons button {
        background: #000;
        border: 2px solid #fff;
    }
    
    .dot {
        border: 2px solid #fff;
    }
    
    .thumbnail {
        border-width: 3px;
    }
}