/* Gallery Container */
.anvio-gallery {
    position: relative;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gallery-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 600;
}

.gallery-description {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Slideshow Container */
.slideshow-container {
    position: relative;
    max-width: 100%;
    margin: auto;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 4px 4px 27px rgb(4 4 4 / 50%);
}

/* Auto-advance Progress Indicator */
.progress-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    z-index: 15;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.slideshow-container:hover .progress-indicator {
    opacity: 0.4;
}

.progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle circle {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
}

.progress-background {
    stroke: rgb(255 255 255 / 83%);
}

.progress-bar {
    stroke: rgb(239 30 30 / 90%);
    stroke-dasharray: 113; /* 2π * 18 (radius) */
    stroke-dashoffset: 113;
}

.slide {
    display: none;
    position: relative;
    cursor: pointer;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    display: block;
}

.slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
}

.slide-content {
    padding: 20px;
    background: linear-gradient(135deg, #277a5e 0%, #2aa884 100%);
    color: white;
}

.slide-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.slide-description {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.95;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

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

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

/* Dots Indicator */
.dots-container {
    text-align: center;
    padding: 20px 0;
    background: #ffffff00;
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active,
.dot:hover {
    background-color: #667eea;
    transform: scale(1.2);
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(230 230 230 / 83%);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fullscreen-content {
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.fullscreen-image {
    background: white;
    max-width: 90%;
    max-height: 70%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.fullscreen-caption {
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 20px 30px;
    margin-top: 20px;
    border-radius: 8px;
    max-width: 80%;
    text-align: center;
}

.fullscreen-caption h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.fullscreen-caption p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* Enhanced Close Button */
.close {
    position: absolute;
    top: 80px;
    right: 20px;
    color: #333;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background-color: rgba(255, 162, 162, 0.92);
    border-radius: 50%;
    padding-bottom: 5px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.close:hover,
.close:focus {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.modal-authors,
.modal-reference {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

.modal-authors strong,
.modal-reference strong {
    color: #333;
    margin-right: 5px;
}

.modal-authors a,
.modal-reference a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.modal-authors a:hover,
.modal-reference a:hover {
    border-bottom-color: #667eea;
}

.fullscreen-caption {
    max-height: 60vh;
    overflow-y: auto;
}

.modal-instructions {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 14px;
    z-index: 1001;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.modal-instructions.fade-out {
    opacity: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .anvio-gallery {
        padding: 0 10px;
    }

    .gallery-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .gallery-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .slide img {
        height: 250px;
    }

    .slide-content {
        padding: 15px;
    }

    .slide-title {
        font-size: 1.2rem;
    }

    .slide-description {
        font-size: 0.9rem;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .prev {
        left: 10px;
    }

    .next {
        right: 10px;
    }

    .fullscreen-caption {
        padding: 15px 20px;
        max-width: 90%;
    }

    .fullscreen-caption h3 {
        font-size: 1.2rem;
    }

    .fullscreen-caption p {
        font-size: 0.9rem;
    }

    /* Mobile close button and progress indicator adjustments */
    .close {
        top: 15px;
        right: 20px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }

    .modal-instructions {
        top: 70px;
        font-size: 12px;
        padding: 6px 12px;
    }

    .progress-indicator {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .progress-circle circle {
        stroke-width: 2;
    }

    .progress-bar {
        stroke-dasharray: 85; /* 2π * 13.5 (smaller radius) */
        stroke-dashoffset: 85;
    }
}
