/**
 * Enhanced Gallery Slideshow Styles
 */

/* Slideshow Wrapper */
.egs-slideshow-wrapper {
    position: relative;
    width: 100%;
    margin: 0;
    padding-bottom: 40px;
    
}

/* Slideshow Container */
.egs-slideshow {
    position: relative;
    width: 100%;
    background: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Orientation Specific Styles */
.egs-slideshow-horizontal {
    aspect-ratio: 16/9;
}

.egs-slideshow-vertical {
    aspect-ratio: 3/4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Slides Container */
.egs-slideshow-slides {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Individual Slide */
.egs-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.egs-slide.egs-slide-active {
    opacity: 1;
}

.egs-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Slide Caption */
.egs-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    padding: 40px 20px 20px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.egs-slide.egs-slide-active .egs-slide-caption {
    transform: translateY(0);
}

/* Arrow Navigation */
.egs-slideshow-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.egs-arrow {
    /* Reset all possible theme button styles */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    color: #fff !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 48px;
    font-weight: bold;
    font-family: Arial, sans-serif !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    transition: color 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    opacity: 0;
    outline: none !important;
    box-sizing: content-box !important;
}

.egs-slideshow:hover .egs-arrow {
    opacity: 1;
}

.egs-arrow:hover {
    color: #fff !important;
    background: none !important;
    transform: translateY(-50%) scale(1.2) !important;
    text-decoration: none !important;
}

.egs-arrow:focus {
    outline: 2px solid #fff !important;
    outline-offset: 4px;
    opacity: 1;
    color: #fff !important;
    background: none !important;
    text-decoration: none !important;
}

.egs-arrow:active {
    color: #fff !important;
    background: none !important;
    transform: translateY(-50%) scale(1) !important;
    text-decoration: none !important;
}

.egs-arrow-prev {
    left: 15px;
}

.egs-arrow-next {
    right: 15px;
}

.egs-arrow-icon {
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: normal !important;
    text-decoration: none !important;
}

/* Dot Navigation - Now positioned absolutely within slideshow container */
.egs-slideshow-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    z-index: 10;
    margin-bottom: -40px;
}

.egs-dot {
    /* Reset all possible theme button styles */
    width: 12px !important;
    height: 12px !important;
    min-width: unset !important;
    min-height: unset !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    font-family: inherit !important;
    font-weight: normal !important;
    text-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
    box-sizing: content-box !important;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.egs-dot:hover {
    background: rgba(0, 0, 0, 0.5) !important;
    transform: scale(1.2);
    text-decoration: none !important;
    border: none !important;
}

.egs-dot:focus {
    outline: 2px solid #333 !important;
    outline-offset: 2px;
    background: rgba(0, 0, 0, 0.5) !important;
    text-decoration: none !important;
}

.egs-dot:active {
    transform: scale(1);
    text-decoration: none !important;
}

.egs-dot.egs-dot-active {
    background: #333 !important;
}

/* Auto-advance pause on hover */
.egs-slideshow[data-auto-advance="true"]:hover {
    /* Pausing will be handled by JavaScript */
}

/* Loading State */
.egs-slideshow.egs-loading {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.egs-slideshow.egs-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: egs-slideshow-spin 1s linear infinite;
}

@keyframes egs-slideshow-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .egs-slideshow-wrapper {
        margin: 15px 0;
    }

    .egs-arrow {
        font-size: 40px !important;
    }
    
    .egs-arrow-prev {
        left: 10px;
    }
    
    .egs-arrow-next {
        right: 10px;
    }
    
    .egs-slideshow-dots {
        bottom: 12px;
        gap: 6px;
        margin-bottom: -40px;
    }
    
    .egs-dot {
        width: 8px !important;
        height: 8px !important;
    }
    
    .egs-slide-caption {
        padding: 30px 15px 15px;
        font-size: 13px;
    }
    
    /* Always show arrows on mobile for better usability */
    .egs-arrow {
        opacity: 0.7;
    }
    
    .egs-slideshow:hover .egs-arrow {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .egs-slideshow-wrapper {
        margin: 10px 0;
    }

    .egs-arrow {
        font-size: 36px !important;
    }
    
    .egs-arrow-prev {
        left: 8px;
    }
    
    .egs-arrow-next {
        right: 8px;
    }
    
    .egs-slideshow-dots {
        bottom: 10px;
        gap: 5px;
        margin-bottom: -40px;
    }
    
    .egs-dot {
        width: 6px !important;
        height: 6px !important;
    }
    
    .egs-slide-caption {
        padding: 25px 12px 12px;
        font-size: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .egs-arrow,
    .egs-dot {
        border: 2px solid #fff;
    }
    
    .egs-slide-caption {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .egs-slide,
    .egs-slide-caption,
    .egs-arrow,
    .egs-dot {
        transition: none;
    }
    
    /* Disable auto-advance for users who prefer reduced motion */
    .egs-slideshow[data-auto-advance="true"] {
        /* Will be handled by JavaScript to respect user preferences */
    }
}

/* Focus management for accessibility */
.egs-slideshow:focus-within .egs-arrow,
.egs-slideshow:focus-within .egs-dot {
    opacity: 1;
}