/**
 * Image Slider Swiper - Frontend Styles
 * Author: High Grade Design
 */

/* ============================================
   Base Container
   ============================================ */
.image-slider-swiper {
    max-width: 500px;
    margin: 0 auto 40px;
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
}

.image-slider-swiper__container {
    position: relative;
    width: 100%;
    height: auto;
}

/* ============================================
   Swiper Override
   ============================================ */
.image-slider-swiper .swiper {
    width: 100%;
    height: auto;
}

.image-slider-swiper .swiper-wrapper {
    align-items: stretch;
}

.image-slider-swiper .swiper-slide {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Slide Content
   ============================================ */
.image-slider-swiper__slide {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Auto height support */
.image-slider-swiper[data-auto-height="true"] .image-slider-swiper__slide {
    height: auto;
    min-height: 200px;
}

.image-slider-swiper[data-auto-height="true"] .image-slider-swiper__image {
    width: 100%;
    height: auto;
}

/* Display mode specific styles */
.image-slider-swiper[data-display-mode="contain"] .image-slider-swiper__slide {
    background: #f8f9fa;
}

.image-slider-swiper[data-display-mode="contain"] .image-slider-swiper__image {
    object-fit: contain;
}

.image-slider-swiper[data-display-mode="cover"] .image-slider-swiper__image {
    object-fit: cover;
}

.image-slider-swiper[data-display-mode="fill"] .image-slider-swiper__image {
    object-fit: fill;
}

.image-slider-swiper__image {
    width: 100%;
    object-position: center;
    transition: transform 0.3s ease;
}

.image-slider-swiper__slide:hover .image-slider-swiper__image {
    transform: scale(1.05);
}

/* ============================================
   Caption
   ============================================ */
.image-slider-swiper__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 40px 20px 20px;
    font-size: 0.95em;
    line-height: 1.5;
    text-align: center;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Navigation Buttons
   ============================================ */
.image-slider-swiper .swiper-button-prev,
.image-slider-swiper .swiper-button-next {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.image-slider-swiper .swiper-button-prev:hover,
.image-slider-swiper .swiper-button-next:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.image-slider-swiper .swiper-button-prev::after,
.image-slider-swiper .swiper-button-next::after {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.image-slider-swiper .swiper-button-prev.swiper-button-disabled,
.image-slider-swiper .swiper-button-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   Pagination
   ============================================ */
.image-slider-swiper .swiper-pagination {
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
}

.image-slider-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 0 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-slider-swiper .swiper-pagination-bullet-active {
    background: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Empty State
   ============================================ */
.image-slider-swiper__empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1em;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    margin: 20px 0;
}

.image-slider-swiper__empty::before {
    content: '🖼️';
    display: block;
    font-size: 3em;
    margin-bottom: 16px;
}

/* ============================================
   Multiple Slides per View
   ============================================ */
.image-slider-swiper[data-slides="2"] .image-slider-swiper__slide {
    height: 300px;
}

.image-slider-swiper[data-slides="3"] .image-slider-swiper__slide {
    height: 250px;
}

.image-slider-swiper[data-slides="4"] .image-slider-swiper__slide {
    height: 200px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .image-slider-swiper {
        margin: 0 10px 30px;
        border-radius: 8px;
    }
    
    .image-slider-swiper__slide {
        height: 280px;
    }
    
    .image-slider-swiper__caption {
        padding: 30px 16px 16px;
        font-size: 0.9em;
    }
    
    .image-slider-swiper .swiper-button-prev,
    .image-slider-swiper .swiper-button-next {
        width: 40px;
        height: 40px;
    }
    
    .image-slider-swiper .swiper-button-prev::after,
    .image-slider-swiper .swiper-button-next::after {
        font-size: 14px;
    }
    
    .image-slider-swiper .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }
}

@media (max-width: 480px) {
    .image-slider-swiper {
        margin: 0 5px 20px;
        border-radius: 6px;
    }
    
    .image-slider-swiper__slide {
        height: 250px;
    }
    
    .image-slider-swiper__caption {
        padding: 20px 12px 12px;
        font-size: 0.85em;
    }
    
    .image-slider-swiper .swiper-button-prev,
    .image-slider-swiper .swiper-button-next {
        width: 35px;
        height: 35px;
    }
    
    .image-slider-swiper .swiper-button-prev::after,
    .image-slider-swiper .swiper-button-next::after {
        font-size: 12px;
    }
}

/* ============================================
   Loading State
   ============================================ */
.image-slider-swiper__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f8f9fa;
    color: #666;
    font-size: 1.1em;
}

.image-slider-swiper__loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-left-color: #667eea;
    border-radius: 50%;
    animation: swiper-loading-spin 1s linear infinite;
    margin-right: 12px;
}

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

/* ============================================
   Dark Mode Support
   ============================================ */
@media (prefers-color-scheme: dark) {
    .image-slider-swiper {
        background: #1a1a1a;
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.3),
            0 1px 4px rgba(0, 0, 0, 0.2);
    }
    
    .image-slider-swiper__slide {
        background: #2a2a2a;
    }
    
    .image-slider-swiper .swiper-button-prev,
    .image-slider-swiper .swiper-button-next {
        background: rgba(42, 42, 42, 0.9);
    }
    
    .image-slider-swiper .swiper-button-prev::after,
    .image-slider-swiper .swiper-button-next::after {
        color: #fff;
    }
    
    .image-slider-swiper__empty {
        background: #2a2a2a;
        color: #ccc;
        border-color: #444;
    }
    
    .image-slider-swiper__loading {
        background: #2a2a2a;
        color: #ccc;
    }
}

/* ============================================
   High Contrast Mode
   ============================================ */
@media (prefers-contrast: high) {
    .image-slider-swiper {
        border: 2px solid;
    }
    
    .image-slider-swiper .swiper-button-prev,
    .image-slider-swiper .swiper-button-next {
        border: 2px solid;
    }
    
    .image-slider-swiper .swiper-pagination-bullet {
        border: 1px solid;
    }
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .image-slider-swiper__image,
    .image-slider-swiper .swiper-button-prev,
    .image-slider-swiper .swiper-button-next,
    .image-slider-swiper .swiper-pagination-bullet {
        transition: none;
    }
    
    .image-slider-swiper__slide:hover .image-slider-swiper__image {
        transform: none;
    }
    
    .image-slider-swiper .swiper-button-prev:hover,
    .image-slider-swiper .swiper-button-next:hover {
        transform: none;
    }
}