/* Front-end Gallery Styles */
.modal-backdrop.show {
    opacity: 0.9 !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.85) !important;
}


.modal {
    pointer-events: none;
}
.modal-dialog {
    pointer-events: all;
}


.gallery-container {
    padding: 40px 0 20px;
}

.elegant-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 8px;
}

.gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
    animation-delay: calc(var(--order) * 0.1s);
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

.image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    background-color: #f8f9fa;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background-color: #f8f9fa;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.05);
    cursor: pointer;
}


.loading {
    position: relative;
    min-height: 200px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--colorPrimary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}



.modal-content {
    background-color: transparent;
    border: none;
}

.glide__slide {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    min-height: 50vh;
}

.glide__slide img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.modal-body {
    min-height: auto;
    height: auto;
    padding: 0;
}

.modal-footer {
    background-color: rgba(255, 255, 255, 0.9);
    border-top: 1px solid #eee;
    padding: 10px;
    width: 50%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}


.modal-footer .nav-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px;
}


.modal-footer h5 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
    margin: 0;
    font-size: 1rem;
}


.modal-footer .action-buttons {
    display: flex;
    gap: 10px;
}


.glide__arrows {
    position: absolute;
    bottom: 0;
    left: 30%;
    right: 30%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    background-color: white;
    padding: 10px;
    border-radius: 4px 4px 0 0;
    pointer-events: none;
}


.glide__arrow {
    pointer-events: all;
}


.glide__arrow--left {
    left: unset;
}

.glide__arrow--right {
    right: unset;
}


@media (max-width: 768px) {
    .modal-content {
        width: 100%;
    }

    .glide__slide img {
        
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
    
    .modal-body {
        min-height: auto;
        height: auto;
        padding: 0;
    }

    .modal-footer {
        background-color: rgba(255, 255, 255, 0.9);
        border-top: 1px solid #eee;
        padding: 8px;
        width: 100%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .modal-footer h5 {
        max-width: 50vw;
        font-size: 0.9rem;
    }
    
    .glide__arrow {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {

    .modal-content {
        width: 100%;
    }
    .glide__slide {
        min-height: 40vh;
    }
    
    .glide__slide img {
        
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }

    .modal-body {
        min-height: auto;
        height: auto;
        padding: 0;
    }
    
    .modal-footer {
        background-color: rgba(255, 255, 255, 0.9);
        border-top: 1px solid #eee;
        padding: 8px;
        width: 100%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0px;
    }
    
    .modal-footer .nav-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer h5 {
        order: -1;
        max-width: 80vw;
    }
    
    .modal-footer .action-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .modal-dialog {
        margin: 0.5rem auto;
    }
}