/**
 * Donation Modal Popup
 * Всплывающее окно для пожертвований
 */

/* Modal Base Styles */
.modal-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Generic UI modal (used instead of browser alert/confirm) */
.msp-ui-modal .modal-popup__container {
    width: 520px;
    height: auto;
    max-height: 80vh;
}

.msp-ui-modal .modal-popup__first-container {
    padding: 32px 24px 16px;
}

.msp-ui-modal .modal-popup__second-container {
    padding: 0 24px 24px;
    flex-direction: row;
    justify-content: center;
}

.msp-ui-modal__btn {
    min-width: 120px;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Source Sans 3';
}

.msp-ui-modal__btn--primary {
    background: var(--color-accent, #8FB56C);
    color: #fff;
}

.msp-ui-modal__btn--secondary {
    background: #fff;
    color: var(--color-text, #303030);
    border-color: #EDEDED;
}

.msp-ui-modal__btn--danger {
    background: var(--color-error, #E11D48);
    color: #fff;
}

.modal-popup.active {
    opacity: 1;
    visibility: visible;
}

.modal-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-popup__container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 592px;
    height: 494px;
    background: var(--color-surface, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-popup.active .modal-popup__container {
    transform: translate(-50%, -50%) scale(1);
}

.modal-popup__content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Close Button */
.modal-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text-muted, #6b7280);
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-popup__close:hover {
    background: var(--color-background, #f3f4f6);
    color: var(--color-text-secondary, #374151);
}

.modal-popup__close svg {
    width: 20px;
    height: 20px;
}

/* First Container */
.modal-popup__first-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    padding-bottom: 32px;
}

.modal-popup__image {
    width: 154px;
    height: 160px;
    margin-bottom: 12px;
}

.modal-popup__title {
    color: var(--color-text, #303030);
    margin: 0 0 16px 0;
    font-family: 'Source Sans 3';
}

.modal-popup__subtitle {
    color: var(--color-text-secondary, #4D4D4D);
    margin: 0;
    line-height: 20px;
}

/* Second Container */
.modal-popup__second-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modal-popup__donate-button {
    width: 100%;
    max-width: 400px;
    padding: 16px;
    background: var(--color-accent, #8FB56C);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: white;
}

.modal-popup__donate-button:hover {
    background: var(--color-accent-hover, #7a9f5a);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(143, 181, 108, 0.3);
}

.modal-popup__footer-text {
    font-size: 12px;
    color: var(--color-text-secondary, #4D4D4D);
    margin: 0 0 24px 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modal-popup__container {
        width: 95%;
        height: auto;
        max-height: 90vh;
        margin: 16px;
    }
    
    .modal-popup__first-container {
        padding: 24px 20px;
    }
    
    .modal-popup__image {
        width: 120px;
        height: 124px;
        margin-bottom: 16px;
    }
    
    .modal-popup__title {
        font-size: 20px;
    }
    
    .modal-popup__subtitle {
        font-size: 14px;
    }
    
    .modal-popup__second-container {
        padding: 24px 20px 32px;
    }
    
    .modal-popup__donate-button {
        max-width: 100%;
    }
}

/* Animation for modal appearance */
@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}
