.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}


.modal {
    background: white;
    border-radius: 12px;
    padding: 32px;
    height: 80vh;
    width: 50%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0; /* Prevents header from shrinking */
}

.modal-header h3 {
    color: #333;
    font-size: 22px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}


.modal-body {
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
    max-height: 90vh;
    max-width: 70vw;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0; /* Critical for flex overflow */
}


.modal-body img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}


.button-copy {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}