/* Base Slider Styles */
.ess-slider-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 200px;
}

.ess-swiper:not(.ess-autoscale) {
    width: 100%;
    height: 400px; /* Fallback, overridden by Elementor control */
    position: relative;
}

.ess-swiper.ess-autoscale {
    width: 100%;
    height: auto;
    position: relative;
}

.swiper-slide.ess-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

/* Default Image Behavior */
.ess-slide-image.ess-image-default {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Autoscale Image Behavior */
.ess-slide-autoscale {
    width: 100%;
    position: relative;
}

.ess-slide-image.ess-image-autoscale {
    display: block;
    max-width: none;
    height: auto;
}

/* Scale Behaviors */
.ess-scale-cover .ess-image-autoscale {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ess-scale-contain .ess-image-autoscale {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ess-scale-fill .ess-image-autoscale {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.ess-scale-scale-down .ess-image-autoscale {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
}

/* Height Behaviors */
.ess-height-auto {
    height: auto !important;
}

.ess-height-auto .ess-image-autoscale {
    width: 100%;
    height: auto;
    object-fit: none;
}

.ess-height-viewport {
    height: 100vh !important;
}

.ess-height-fixed {
    /* Uses default slider height */
}

.ess-height-custom {
    /* Height set inline via style attribute */
}

/* Full Browser Width */
.ess-slide-fullwidth {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    position: relative;
}

.ess-slide-fullwidth .ess-image-autoscale {
    width: 100vw;
}

/* Content Overlay */
.ess-slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    padding: 30px;
    border-radius: 8px;
    max-width: 80%;
    z-index: 2;
}

.ess-slide-content h3 {
    margin: 0 0 15px 0;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.ess-slide-description {
    font-size: 1.1em;
    line-height: 1.5;
    margin: 0;
}

/* No Slides Message */
.ess-no-slides {
    text-align: center;
    padding: 50px 20px;
    font-style: italic;
    color: #666;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fallback styles when Swiper fails */
.ess-swiper:not(.swiper-initialized) .swiper-slide {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 400px !important;
    margin-bottom: 20px;
}

/* Animation styles */
.ess-slide {
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.ess-animate-fade {
    animation: essSlideIn 0.8s ease-out forwards;
}

@keyframes essSlideIn {
    from { opacity: 0; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

.ess-animate-slide-up .ess-slide-content {
    animation: essSlideUp 0.8s ease-out forwards;
}

@keyframes essSlideUp {
    from { opacity: 0; transform: translate(-50%, -30%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.ess-animate-slide-down .ess-slide-content {
    animation: essSlideDown 0.8s ease-out forwards;
}

@keyframes essSlideDown {
    from { opacity: 0; transform: translate(-50%, -70%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.ess-animate-zoom .ess-slide-content {
    animation: essZoomIn 0.8s ease-out forwards;
}

@keyframes essZoomIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Swiper Navigation */
.ess-swiper .swiper-button-next,
.ess-swiper .swiper-button-prev {
    color: white;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ess-swiper .swiper-button-next:hover,
.ess-swiper .swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.ess-swiper .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ess-swiper .swiper-pagination-bullet-active {
    background: white;
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ess-slide-content {
        padding: 20px;
        max-width: 90%;
    }
    .ess-slide-content h3 {
        font-size: 1.5em;
    }
    
    /* Mobile autoscale adjustments */
    .ess-slide-fullwidth {
        margin-left: calc(-50vw + 50%) !important;
    }
}

@media (max-width: 480px) {
    .ess-slide-content {
        padding: 15px;
    }
    .ess-slide-content h3 {
        font-size: 1.3em;
        margin-bottom: 10px;
    }
}

/* High DPI / Retina Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .ess-image-autoscale {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}