/* ===================================
   Photo Modal Styles
   =================================== */

/* Modal Container */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.active {
    display: flex;
    opacity: 1;
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.modal-content {
    position: relative;
    margin: auto;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    padding: 20px;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(30, 30, 30, 0.95);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e4e4e4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.modal-close:hover {
    background: var(--primary-color, #4da6ff);
    color: #121212;
    transform: rotate(90deg);
}

/* Modal Image Container */
.modal-image-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: modalFadeIn 0.4s ease;
}

/* Loading animation for modal image */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Focus trap for accessibility */
.photo-modal.active .modal-close:focus {
    outline: 3px solid #4da6ff;
    outline-offset: 2px;
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 10px;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 5px;
        right: 5px;
    }

    .modal-image-container {
        max-height: 70vh;
    }

    .modal-image-container img {
        max-height: 70vh;
        border-radius: 4px;
    }
}

/* Landscape Mobile */
@media (max-width: 920px) and (orientation: landscape) {
    .modal-image-container {
        max-height: 85vh;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .photo-modal,
    .modal-close,
    .modal-image-container img {
        transition: none !important;
        animation: none !important;
    }
}
