/**
 * Mobilis Custom Slider - Ultra-Performant Frontend Styles
 *
 * @package MOBILISDES
 * @since 1.4.0
 *
 * Performance optimizations:
 * - GPU-accelerated transitions (transform, opacity)
 * - will-change for optimized animations
 * - Ken Burns effect optimized
 * - Mobile-first responsive design
 * - No !important flags
 */

/* Slider Container */
.mobilis-custom-slider {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: #000;
}

@media (max-width: 1024px) {
    .mobilis-custom-slider {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .mobilis-custom-slider {
        min-height: 600px;
    }

    .slider-wrapper,
    .slide,
    .slide-background {
        min-height: 600px;
        height: 100%;
    }
}

/* Slider Wrapper */
.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Slide */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.6s ease,
        visibility 0.6s ease;
    will-change: opacity;
}

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

/* Slide Background */
.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Slide Overlay */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.slide-bg-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center;
}

/* Ken Burns Animation - GPU Optimized */
/* Disable on first slide initially for better LCP */
.slide:not(:first-child).active .slide-bg-image,
.slide:first-child.ken-burns-ready .slide-bg-image {
    will-change: transform;
    animation: kenBurns 12s ease-out forwards;
}

@keyframes kenBurns {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Disable Ken Burns on mobile and tablet for better performance */
@media (max-width: 1024px) {
    .slide.active .slide-bg-image {
        animation: none;
    }

    .slide-bg-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transform: none !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    .slide-background {
        min-height: 100%;
    }
}

@media (max-width: 768px) {
    .slide-content {
        padding-top: 40px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 20px;
    }

    .slide-content .slide-content-inner {
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0px !important;
        padding-right: 0px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Slide Content */
.slide-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    padding-top: 100px;
    width: 100%;
    height: 100%;
    padding-left: 30px;
    padding-right: 30px;
    padding-bottom: 40px;
}

/* Slide Content Alignment */
.slide-content-align-left {
    justify-content: flex-start;
    text-align: left;
}

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

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

.slide-content-inner {
    max-width: 85% !important;
    width: auto !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    color: #fff !important;
    transform: translateY(20px);
    opacity: 0;
    transition:
        transform 0.8s ease,
        opacity 0.8s ease;
    transition-delay: 0.2s;
}

.slide.active .slide-content-inner {
    transform: translateY(0);
    opacity: 1;
}

/* Slide Text */
.slide-subtitle {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    opacity: 0.9;
    color: inherit !important;
}

/* Inline images in subtitle (e.g., logo replacing emoji) */
.slide-subtitle img,
.slide-subtitle svg {
    width: 35px;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
    visibility: visible !important;
    opacity: 1 !important;
}

.slide-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: inherit !important;
}

/* Inline images in title (e.g., logo replacing emoji) */
.slide-title img,
.slide-title svg {
    width: 85px !important;
    height: 64.3px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 5px;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.slide-description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.95;
    color: inherit !important;
}

/* Inline images in description (e.g., logo replacing emoji) */
.slide-description img {
    width: 35px;
    height: auto;
    display: inline;
    vertical-align: middle;
    margin: 0 2px;
}

/* Responsive Typography */
@media (max-width: 1024px) {
    .slide-subtitle {
        font-size: 14px;
    }

    .slide-subtitle img {
        width: 30px;
    }

    .slide-title {
        font-size: 36px;
    }

    .slide-title img,
    .slide-title svg {
        width: 65px !important;
        height: 49.1px !important;
    }

    .slide-description {
        font-size: 16px;
    }

    .slide-description img {
        width: 30px;
    }
}

@media (max-width: 768px) {
    .slide-subtitle {
        font-size: 12px;
    }

    .slide-subtitle img,
    .slide-subtitle svg {
        width: 25px !important;
        height: auto !important;
    }

    .slide-title {
        font-size: 28px;
    }

    .slide-title img,
    .slide-title svg {
        width: 50px !important;
        height: 37.8px !important;
    }

    .slide-description {
        font-size: 14px;
    }

    .slide-description img {
        width: 25px;
    }
}

/* Slide Button */
.slide-button {
    display: inline-block;
    padding: 10px 22px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slide-button.button-solid {
    background: #ffffff5e;
    color: #fff !important;
    border: 2px solid transparent;
}

.slide-button.button-solid i {
    margin-right: 8px;
    color: #fff !important;
}

.slide-button.button-solid:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

.slide-button.button-transparent {
    background: transparent;
    color: #fff !important;
    border: 2px solid #fff;
}

.slide-button.button-transparent i {
    margin-right: 8px;
    color: #fff !important;
}

.slide-button.button-transparent:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border-color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .slide-button {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    pointer-events: none;
}

.slider-prev,
.slider-next {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    box-shadow: none;
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.slider-prev svg,
.slider-next svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

@media (max-width: 768px) {
    .slider-prev,
    .slider-next {
        width: 40px;
        height: 40px;
    }

    .slider-prev svg,
    .slider-next svg {
        width: 20px;
        height: 20px;
    }
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    z-index: 3;
    display: flex;
    gap: 12px;
    transform: translateX(-50%);
}

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

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

.slider-dot.active {
    background: #00b259;
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .slider-dots {
        bottom: 20px;
        gap: 8px;
    }

    .slider-dot {
        width: 10px;
        height: 10px;
    }
}

/* Empty State */
.mobilis-custom-slider-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    background-image: url("/wp-content/uploads/2025/09/20250805-_DSC0897_New_RGB_CAV_SENIOR.jpg");
    background-size: cover;
}

/* Preload optimization */
.slide:first-child .slide-bg-image {
    /* First slide image should be preloaded in HTML */
}
