.image-popup {
    aspect-ratio: 16 / 9;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 16px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--popup-border);
    display: block;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.image-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(88, 120, 243, 0.1), rgba(168, 85, 247, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-popup:hover::before {
    opacity: 1;
}

.image-popup:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 5px 15px rgba(88, 120, 243, 0.3);
}

.image-popup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s ease;
}

.image-popup:hover img {
    transform: scale(1.05);
}

.image-popup.no-scale {
    aspect-ratio: auto;
    height: auto;
}

.image-popup.no-scale img {
    height: auto;
    object-fit: contain;
}

/* Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    overflow: hidden;
}

.image-modal-content {
    width: 80%;
    height: 80%;
    overflow: auto;
    position: relative;
    border-radius: 10px;
    background: var(--modal-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-modal-content.no-scale {
    height: auto;
    max-height: 80%;
}

.image-modal-content.no-scale img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.image-modal-content img {
    width: 100%;
    max-width: none;
    max-height: none;
    display: block;
}

.image-modal-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    z-index: 2;
}

/* Animations */
@keyframes fadeIn {
    from { background: rgba(0, 0, 0, 0); }
    to { background: rgba(0, 0, 0, 0.85); }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}