/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 110;
    padding-top: 1%;
    padding-bottom: 1%;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    width: 96vw;
    height: 96vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.slides-wrapper {
    width: 100%;
    height: calc(100% 80px);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.close {
    position: absolute;
    display: flex;
    top: 25px;
    right: 35px;
    width: 35px;
    height: 35px;
    text-align: center;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    color: #ffffffe1;
    text-shadow: 3px 3px 5px darkviolet;
    background-color: rgba(211, 51, 232, 0.819);
    padding-bottom: 6px;
    border: 1px solid white;
    padding-right: 2px;
    border-radius: 30px;
    font-size: 45px;
    font-weight: bold;
    transition: 0.2s;
    z-index: 200;
}

.close:hover, .close:focus {
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid pink;
    background-color: rgba(235, 11, 11, 0.911);
}

.mySlides {
    display: none;
    position: relative;
    height: 100%;
    width: 100%;
    opacity: 0;
    transform: translateX(0);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.mySlides.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.mySlides.slide-out-left {
    opacity: 0;
    transform: translateX(-50px);
}

.mySlides.slide-out-right {
    opacity: 0;
    transform: translateX(50px);
}

.mySlides img {
    height: 92vh;
    max-width: 86%;
    margin: 0 auto;
    display: block;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.alt-text-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 99%;
    height: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255);
    color: #8c8c8c;
    font-size: 12px;
    font-style: italic;
    padding: 0;
    padding-top: 5px;
    text-align: center;
    z-index: 120;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -50px;
    padding: 16px;
    color: #bebdbd;
    font-weight: bold;
    font-size: 30px;
    border-radius: 0 3px 3px 0;
    user-select: none;
    transition: 0.4s ease;
    z-index: 130;
}

.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Ebook trigger styles */
.ebook-trigger {
    cursor: pointer;
    max-width: 300px;
    margin: 20px auto;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgb(148, 0, 211, 0.3);
    border-radius: 4px;
    padding-right: 120px;
    padding-left: 120px;
    /* box-shadow: 0 2px 6px rgbxa(0, 0, 0, 0.1); */
}

.ebook-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2)
}

.ebook-trigger img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.ebook-trigger p {
    margin-top: 12px;
    color: #666;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 769px) {
    .mySlides img {
        height: 90vh;  /* Reduced from 90vh */
        max-width: 92%;  /* Increased from 86% to use more screen space */
    }

    .prev, .next {
        font-size: 20px;
        padding: 12px;  /* Slightly reduced padding */
        background-color: #c8c1c1;
        color: #666;
    }

    .close {
        width: 35px;  /* Reduced from 45px */
        height: 35px;  /* Reduced from 45px */
        font-size: 35px;  /* Reduced from 45px */
        top: 20px;  /* Moved up slightly */
        right: 20px;  /* Moved in slightly */
    }

    .modal-content {
        width: 95vw;  /* Increased from 85vw to use more screen space */
    }

    .alt-text-container {
        font-size: 10px;
        height: 10px;
    }

    .ebook-trigger {
        max-width: 250px;
        font-size: 14px;
    }
}


/* Loading indicator styles */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-style: italic;
    z-index: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Range Slider Styles */
.gallery-range-slider {
    width: 80%;
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease-in-out, visibility 0.7s ease-in-out;
    cursor: pointer;
    z-index: 130;
    padding: 8px 0;
    margin: 0;
}

.gallery-range-slider.range-slider-visible {
    opacity: 1;
    visibility: visible;
}

/* Webkit (Chrome, Safari, Edge) */
.gallery-range-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: #cac2c2b0;
    border-radius: 3px;
}

.gallery-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #91918b;
    cursor: pointer;
    border-radius: 50%;
    margin-top: -5px;
}

/* Firefox */
.gallery-range-slider::-moz-range-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: #cac2c2b0;
    border-radius: 3px;
}

.gallery-range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #91918b;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Microsoft (IE/Older Edge) */
.gallery-range-slider::-ms-thumb {
    width: 12px;
    height: 12px;
    background: #6c6c67; 
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Responsive adjustments for range slider */
@media (max-width: 769px) {
    .gallery-range-slider {
        width: 90%;
        margin: 12px auto 5px;
    }
}