/* ========== ENHANCED IMAGE MODAL ========== */

/* Action Buttons - LEFT SIDE */
.image-modal__actions-left {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 10001;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Close Button - RIGHT SIDE */
.modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10001;
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    backdrop-filter: blur(var(--glass-blur));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.image-modal__action {
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    backdrop-filter: blur(var(--glass-blur));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.image-modal__action:hover,
.modal-close:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--cyan-glow);
    box-shadow: var(--glow-cyan);
    transform: scale(1.1);
}

.image-modal__action:active,
.modal-close:active {
    transform: scale(0.95);
}

.image-modal__hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 0.75rem 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
    color: var(--text-secondary);
    font-size: var(--text-sm);
    pointer-events: none;
    animation: fade-in 0.3s ease-out;
}

.desktop-only {
    display: none;
}

.mobile-only {
    display: inline;
}

/* Desktop zoom support */
#modalContent {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

#modalContent.zoomed {
    cursor: zoom-out;
}

#modalImage {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    touch-action: pinch-zoom;
}

#modalContent.zoomed #modalImage {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    transform: scale(2);
}

/* Responsive */
@media (min-width: 768px) {
    .desktop-only {
        display: inline;
    }

    .mobile-only {
        display: none;
    }
}

@media (max-width: 768px) {
    .image-modal__actions-left {
        top: 1rem;
        left: 1rem;
        gap: 0.5rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
    }

    .image-modal__action,
    .modal-close {
        width: 38px;
        height: 38px;
    }

    .image-modal__action svg,
    .modal-close svg {
        width: 18px;
        height: 18px;
    }

    .image-modal__hint {
        bottom: 1rem;
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
}

/* Success toast for copy action */
@keyframes toast-slide-up {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.copy-toast {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    background: rgba(0, 240, 255, 0.9);
    color: var(--bg-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    animation: toast-slide-up 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.4);
}