/* Universal Photo Modal & Hover Effects CSS */
/* Works with any page that includes this CSS file */

/* Photo Modal & Hover Effects */
.clickable-image {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* Navigation buttons exclusion from hover effect */
.image-nav {
    position: absolute !important;
    z-index: 20 !important;
    pointer-events: auto !important;
}

/* Ensure navigation buttons are visible and functional */
.clickable-image .image-nav {
    position: absolute !important;
    z-index: 100 !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.clickable-image .image-nav:hover {
    z-index: 100 !important;
    opacity: 1 !important;
}

.clickable-image::after {
    content: '\f00e';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color:#3e3e3e;
    opacity: 0;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.clickable-image:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.clickable-image:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    backdrop-filter: blur(10px);
    animation: photoModalFadeIn 0.3s ease-out;
}

.photo-modal.show {
    display: flex;
}

.photo-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: photoModalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.photo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color:#3e3e3e;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.photo-modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 90vh;
    overflow: hidden;
}

.photo-modal img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 15px;
    cursor: default;
}

@keyframes photoModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes photoModalSlideIn {
    from { 
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes photoModalSlideOut {
    from { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to { 
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
}

/* Mobile responsive for photo modal */
@media (max-width: 768px) {
    .clickable-image::after {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
    }

    .photo-modal-content {
        max-width: 95%;
        max-height: 90vh;
        border-radius: 15px;
    }

    .photo-modal-close {
        font-size: 1.5rem;
        width: 35px;
        height: 35px;
        top: 10px;
        right: 10px;
    }

    .photo-modal img {
        max-height: 85vh;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .clickable-image::after {
        font-size: 1.2rem;
        width: 40px;
        height: 40px;
    }

    .photo-modal-content {
        max-width: 98%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .photo-modal-close {
        font-size: 1.3rem;
        width: 32px;
        height: 32px;
        top: 8px;
        right: 8px;
    }

    .photo-modal img {
        max-height: 90vh;
        border-radius: 8px;
    }
}

/* Modal Gallery Navigation Styles */
.modal-gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.modal-main-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 60vh;
    overflow: hidden;
}

.modal-main-image img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-main-image img:hover {
    transform: scale(1.02);
}

.modal-nav-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color:#3e3e3e;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 50px;
    height: 50px;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.modal-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.modal-thumbnails {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0 1rem;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-thumbnails::-webkit-scrollbar {
    display: none;
}

.modal-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.modal-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.modal-thumbnail.active {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

/* Mobile responsive for modal gallery */
@media (max-width: 768px) {
    .modal-gallery-container {
        gap: 0.5rem;
    }
    
    .modal-main-image {
        max-height: 50vh;
    }
    
    .modal-main-image img {
        max-height: 50vh;
    }
    
    .modal-nav-btn {
        font-size: 1.2rem;
        padding: 10px 12px;
        min-width: 40px;
        height: 40px;
    }
    
    .modal-thumbnails {
        gap: 0.3rem;
        padding: 0 0.5rem;
    }
    
    .modal-thumbnail {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .modal-gallery-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .modal-main-image {
        max-height: 40vh;
    }
    
    .modal-main-image img {
        max-height: 40vh;
    }
    
    .modal-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        font-size: 1rem;
        padding: 8px 10px;
        min-width: 35px;
        height: 35px;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .modal-thumbnails {
        order: -1;
        justify-content: flex-start;
        padding: 0 0.5rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-thumbnail {
        width: 40px;
        height: 40px;
    }
}