/**
 * MN SlideSwipe CSS
 * Template slider with swipe functionality
 */

/* Main Container */
.mn-slideswipe-wrapper {
    position: relative;
    width: 100%;
    overflow: visible; /* Allow arrows to extend beyond */
}

.mn-slideswipe-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
}

/* Swiper Wrapper */
.mn-slideswipe-container .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.mn-slideswipe-container .swiper-slide {
    display: flex;
    align-items: stretch;
    height: auto;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent slides from shrinking */
}

/* Fade Effect */
.mn-slideswipe-container.swiper-fade .swiper-slide {
    opacity: 0;
    transition-property: opacity;
}

.mn-slideswipe-container.swiper-fade .swiper-slide-active {
    opacity: 1;
}

/* Slide as Link */
.mn-slideswipe-container a.swiper-slide {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.mn-slideswipe-container a.swiper-slide:hover {
    opacity: 0.95;
}

.mn-slideswipe-container a.swiper-slide:focus {
    outline: 2px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* Slide Content */
.mn-slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

/* Template Content Styling */
.mn-slide-content > .elementor {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mn-slide-content > .elementor > .elementor-section-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Placeholder Styles */
.mn-slide-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
}

.mn-slide-placeholder h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.mn-slide-placeholder p {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
}

/* Navigation Arrows */
.mn-slideswipe-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 15;
    transition: all 0.3s ease;
    user-select: none;
}

.mn-slideswipe-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.mn-slideswipe-arrow-prev {
    left: 10px;
}

.mn-slideswipe-arrow-next {
    right: 10px;
}

.mn-slideswipe-arrow.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mn-slideswipe-arrow.swiper-button-disabled:hover {
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
}

/* Navigation Dots */
.mn-slideswipe-wrapper .swiper-pagination {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.mn-slideswipe-wrapper .swiper-pagination-top {
    top: 0;
    margin: 20px 0 0 0;
}

.mn-slideswipe-wrapper .swiper-pagination-bottom {
    bottom: 0;
    margin: 0 0 20px 0;
}

.mn-slideswipe-wrapper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
    position: relative;
}

.mn-slideswipe-wrapper .swiper-pagination-bullet:hover {
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.2);
}

.mn-slideswipe-wrapper .swiper-pagination-bullet-active {
    background-color: #007cba;
    transform: scale(1.3);
}

/* Fill Style (Default) - Pill Shape with Progress Fill */
.mn-slideswipe-wrapper.mn-autoplay-active .swiper-pagination-bullet-active {
    width: 56px!important;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 12px;
    transform: scale(1);
    transition: width 0.3s ease, border-radius 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Create semi-transparent background layer */
.mn-slideswipe-wrapper.mn-autoplay-active .swiper-pagination-bullet-active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    opacity: 0.6;
    border-radius: 12px;
    pointer-events: none;
    z-index: 0;
}

/* Progress fill animation for default style */
.mn-slideswipe-wrapper.mn-autoplay-active .swiper-pagination-bullet-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: inherit;
    opacity: 1;
    border-radius: 12px;
    animation: mn-progress-fill var(--autoplay-duration, 3s) linear forwards;
    pointer-events: none;
    z-index: 1;
}

@keyframes mn-progress-fill {
    0% {
        width: 0;
    }
    100% {
        width: 100%;
    }
}

/* Circular Style - Keep original round shape with ring */
.mn-slideswipe-wrapper.mn-progress-style-circular.mn-autoplay-active .swiper-pagination-bullet-active {
    width: 10px;
    border-radius: 50%;
    transform: scale(1.3);
    opacity: 1;
}

.mn-slideswipe-wrapper.mn-progress-style-circular.mn-autoplay-active .swiper-pagination-bullet-active::before {
    display: none;
}

/* Override ::after for circular style to be ring instead of background layer */
.mn-slideswipe-wrapper.mn-progress-style-circular .swiper-pagination-bullet-active::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.8);
    border-right-color: rgba(255, 255, 255, 0.8);
    transform: rotate(-90deg);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Show progress ring when autoplay is active (circular style only) */
.mn-slideswipe-wrapper.mn-progress-style-circular.mn-autoplay-active .swiper-pagination-bullet-active::after {
    opacity: 1;
    animation: mn-progress-spin var(--autoplay-duration, 3s) linear forwards;
}

@keyframes mn-progress-spin {
    0% {
        transform: rotate(-90deg);
    }
    100% {
        transform: rotate(270deg);
    }
}

/* Disable progress animation when mn-progress-disabled class is present */
.mn-slideswipe-wrapper.mn-progress-disabled .swiper-pagination-bullet-active::before,
.mn-slideswipe-wrapper.mn-progress-disabled .swiper-pagination-bullet-active::after {
    display: none;
}

/* Loading State */
.mn-slideswipe-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mn-slideswipe-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: mn-slideswipe-spin 1s linear infinite;
}

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

/* Responsive Design */

/* Desktop (1200px and up) - Default styles apply */

/* Tablet Landscape (1024px - 1199px) */
@media (max-width: 1199px) and (min-width: 1024px) {
    .mn-slideswipe-arrow {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .mn-slideswipe-arrow {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
    
    .mn-slide-placeholder {
        padding: 35px 18px;
    }
    
    .mn-slide-placeholder h3 {
        font-size: 22px;
    }
    
    .mn-slide-placeholder p {
        font-size: 13px;
    }
}

/* Mobile Landscape (480px - 767px) */
@media (max-width: 767px) and (min-width: 480px) {
    .mn-slideswipe-arrow {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    
    .mn-slideswipe-arrow-prev {
        left: 8px;
    }
    
    .mn-slideswipe-arrow-next {
        right: 8px;
    }
    
    .mn-slide-placeholder {
        padding: 30px 15px;
    }
    
    .mn-slide-placeholder h3 {
        font-size: 20px;
    }
    
    .mn-slide-placeholder p {
        font-size: 13px;
    }
}

/* Mobile Portrait (up to 479px) */
@media (max-width: 479px) {
    .mn-slideswipe-arrow {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .mn-slideswipe-arrow-prev {
        left: 5px;
    }
    
    .mn-slideswipe-arrow-next {
        right: 5px;
    }
    
    .mn-slideswipe-wrapper .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }
    
    /* Adjust pill shape for smaller dots on mobile (Fill style) */
    .mn-slideswipe-wrapper.mn-autoplay-active .swiper-pagination-bullet-active {
        width: 40px;
        border-radius: 10px;
    }
    
    /* Adjust progress ring size for smaller dots (Circular style) */
    .mn-slideswipe-wrapper.mn-progress-style-circular .swiper-pagination-bullet-active::after {
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        border-width: 1.5px;
    }
    
    .mn-slide-placeholder {
        padding: 20px 10px;
    }
    
    .mn-slide-placeholder h3 {
        font-size: 18px;
    }
    
    .mn-slide-placeholder p {
        font-size: 12px;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .mn-slideswipe-arrow {
        opacity: 0.8;
    }
    
    .mn-slideswipe-arrow:hover {
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.5);
    }
    
    .mn-slideswipe-wrapper .swiper-pagination-bullet:hover {
        transform: none;
        background-color: rgba(0, 0, 0, 0.3);
    }
}

/* RTL Support */
[dir="rtl"] .mn-slideswipe-arrow-prev {
    right: 10px;
    left: auto;
}

[dir="rtl"] .mn-slideswipe-arrow-next {
    left: 10px;
    right: auto;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mn-slideswipe-arrow {
        background-color: #000000;
        border: 2px solid #ffffff;
    }
    
    .mn-slideswipe-wrapper .swiper-pagination-bullet {
        background-color: #000000;
        border: 1px solid #ffffff;
    }
    
    .mn-slideswipe-wrapper .swiper-pagination-bullet-active {
        background-color: #ffffff;
        border: 2px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .mn-slideswipe-arrow,
    .mn-slideswipe-wrapper .swiper-pagination-bullet {
        transition: none;
    }
    
    .mn-slideswipe-arrow:hover {
        transform: translateY(-50%);
    }
    
    .mn-slideswipe-wrapper .swiper-pagination-bullet:hover {
        transform: none;
    }
}
