/* ====================================================== */
/* Image Modal / Lightbox Component */
/* ====================================================== */

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

/* Light mode overlay */
body.light-mode .image-modal-overlay {
    background: rgba(0, 0, 0, 0.85);
}

.image-modal-content {
    position: relative;
    margin: auto;
    max-width: 95%;
    max-height: 95%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalZoomIn 0.3s ease-out;
}

@keyframes modalZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-modal-content img,
.image-modal-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Close button */
.image-modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
}

/* Light mode close button */
body.light-mode .image-modal-close {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

body.light-mode .image-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Cross icon using pseudo-elements */
.image-modal-close::before,
.image-modal-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

body.light-mode .image-modal-close::before,
body.light-mode .image-modal-close::after {
    background: #333;
}

.image-modal-close::before {
    transform: rotate(45deg);
}

.image-modal-close::after {
    transform: rotate(-45deg);
}

/* Make project images clickable */
.image-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-card img:not(.no-modal) {
    transition: transform 0.3s ease;
}

.image-card:hover img:not(.no-modal) {
    transform: scale(1.05);
}

/* Add a subtle zoom indicator */
.image-card::after {
    content: '\f00e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-card:hover::after {
    opacity: 1;
}

body.light-mode .image-card::after {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Responsive design */
@media (max-width: 768px) {
    .image-modal-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .image-modal-close::before,
    .image-modal-close::after {
        width: 20px;
        height: 2px;
    }

    .image-modal-content {
        max-width: 90%;
        max-height: 90%;
    }

    .image-card::after {
        width: 35px;
        height: 35px;
        font-size: 14px;
        top: 10px;
        right: 10px;
    }
}

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