/* Стили для системы донатов */

/* Контейнер донатов */
.donation-container {
    margin-top: 20px;
    text-align: center;
}

.donation-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Форма доната */
.donation-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Отключаем переходы/анимации при разворачивании блоков (для wallet) */
.donation-form.no-transitions *,
.donation-form.no-transitions {
    transition: none !important;
    animation: none !important;
}

/* Более агрессивное отключение трансформаций для вложенных элементов */
.donation-form.no-transitions .payment-method-option,
.donation-form.no-transitions .crypto-payment-details,
.donation-form.no-transitions .unified-currency-selector,
.donation-form.no-transitions .telegram-wallet-form,
.donation-form.no-transitions .crypto-currency-select {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

.donation-form h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

/* Выбор суммы */
.amount-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.amount-option {
    padding: 8px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.amount-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.amount-option.selected {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

/* Поле ввода суммы */
.amount-input-container {
    margin-bottom: 15px;
}

.amount-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.amount-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.amount-input::placeholder {
    color: #999;
}

/* Выбор валюты */
.currency-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.currency-option {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.currency-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.currency-option.selected {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

/* Поля ввода */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #555;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Кнопка доната */
.donate-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.donate-btn:active {
    transform: translateY(0);
}

.donate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Модальное окно для Stripe */
.stripe-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    /* Учитываем safe areas Telegram */
    padding-top: var(--tg-safe-area-inset-top, var(--safe-area-top, env(safe-area-inset-top, 0px)));
    padding-bottom: var(--tg-safe-area-inset-bottom, var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)));
    padding-left: var(--tg-safe-area-inset-left, var(--safe-area-left, env(safe-area-inset-left, 0px)));
    padding-right: var(--tg-safe-area-inset-right, var(--safe-area-right, env(safe-area-inset-right, 0px)));
}

.stripe-modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    max-height: calc(80vh - var(--tg-safe-area-inset-top, var(--safe-area-top, env(safe-area-inset-top, 0px))) - var(--tg-safe-area-inset-bottom, var(--safe-area-bottom, env(safe-area-inset-bottom, 0px))));
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.stripe-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stripe-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.stripe-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stripe-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Stripe Elements */
.stripe-element {
    margin-bottom: 20px;
}

.stripe-element .StripeElement {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    transition: border-color 0.3s ease;
}

.stripe-element .StripeElement--focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.stripe-element .StripeElement--invalid {
    border-color: #dc3545;
}

/* Статус платежа */
.payment-status {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin: 15px auto;
    font-weight: 500;
    /* Учитываем Safe Areas Telegram */
    margin-top: max(15px, env(safe-area-inset-top));
    margin-left: max(15px, env(safe-area-inset-left));
    margin-right: max(15px, env(safe-area-inset-right));
    max-width: 90%;
}

.payment-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.payment-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.payment-status.processing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Минимальная сумма */
.min-amount {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    text-align: center;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 480px) {
    .donation-form {
        padding: 15px;
    }
    
    .amount-selector {
        gap: 6px;
    }
    
    .amount-option {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .currency-selector {
        gap: 8px;
    }
    
    .currency-option {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .stripe-modal-content {
        padding: 20px;
        width: 95%;
    }
}

/* Уведомления */
.donation-notification {
    position: fixed;
    /* Центрируем по вертикали и горизонтали с учетом Safe Areas Telegram */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Учитываем Safe Areas для корректного позиционирования */
    margin-top: calc((env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / 2);
    max-width: min(350px, calc(100vw - env(safe-area-inset-left, 20px) - env(safe-area-inset-right, 20px) - 40px));
    width: 90%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    animation: fadeInScale 0.3s ease;
    border-left: 4px solid #007bff;
}

.donation-notification.success {
    border-left-color: #28a745;
}

.donation-notification.warning {
    border-left-color: #ffc107;
}

.donation-notification.error {
    border-left-color: #dc3545;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 10px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.notification-title {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: #f0f0f0;
    color: #333;
}

.notification-message {
    padding: 10px 20px 15px 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Адаптивность для уведомлений */
@media (max-width: 480px) {
    .donation-notification {
        /* На мобильных также центрируем с учетом Safe Areas */
        width: calc(100% - env(safe-area-inset-left, 10px) - env(safe-area-inset-right, 10px) - 20px);
        max-width: none;
        padding: 12px;
    }
    
    .notification-header {
        padding: 12px 15px 8px 15px;
    }
    
    .notification-message {
        padding: 8px 15px 12px 15px;
        font-size: 13px;
    }
}

/* ==================== Крипто-платежи ==================== */

/* Выбор способа оплаты */
.payment-method-selector {
    margin: 20px 0;
}

.payment-method-selector h3 {
    font-size: 15px;
    color: var(--active-color);
    margin-bottom: 12px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.payment-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.payment-method-option {
    flex: 1;
    padding: 14px 12px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    backdrop-filter: blur(10px);
}

.payment-method-option input[type="radio"] {
    display: none;
}

.payment-method-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.payment-icon {
    font-size: 20px;
}

.payment-method-option:hover {
    border-color: var(--active-color);
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    transform: translateY(-2px);
}

.payment-method-option.selected {
    border-color: var(--active-color);
    background: rgba(0, 255, 0, 0.2);
    color: var(--active-color);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
}

.payment-method-option.selected .payment-method-label {
    color: var(--active-color);
}

/* Выбор криптовалюты */
.crypto-currency-selector {
    margin: 15px 0;
}

.crypto-currency-selector h3 {
    font-size: 15px;
    color: var(--active-color);
    margin-bottom: 10px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.crypto-currency-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 10px;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.crypto-currency-select option {
    background: var(--base-bg);
    color: #fff;
}

.crypto-currency-select:hover {
    border-color: var(--active-color);
    background: rgba(0, 255, 0, 0.1);
}

.crypto-currency-select:focus {
    outline: none;
    border-color: var(--active-color);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
    background: rgba(0, 255, 0, 0.15);
}

/* Детали крипто-платежа */
.crypto-payment-details {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 0, 0.4);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.2);
}

/* Статус крипто-платежа */
.crypto-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--active-color);
    box-shadow: 0 0 10px var(--active-color);
    animation: pulse 2s infinite;
}

.status-indicator.waiting {
    background: #ffc107;
    box-shadow: 0 0 10px #ffc107;
}

.status-indicator.confirming {
    background: #17a2b8;
    box-shadow: 0 0 10px #17a2b8;
}

.status-indicator.completed {
    background: var(--active-color);
    box-shadow: 0 0 15px var(--active-color);
    animation: none;
}

.status-indicator.failed {
    background: #dc3545;
    box-shadow: 0 0 10px #dc3545;
    animation: none;
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Отображение суммы в крипте */
.crypto-amount-display {
    text-align: center;
    margin-bottom: 15px;
}

.crypto-amount-display p:first-child {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.crypto-amount-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--active-color);
    margin: 0;
    word-break: break-word;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Контейнер адреса */
.crypto-address-container {
    margin-bottom: 15px;
}

.crypto-address-container > p:first-child {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    text-align: left;
}

.address-display {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.crypto-address-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.4);
    color: var(--active-color);
    word-break: break-all;
    transition: all 0.3s ease;
}

.crypto-address-input:focus {
    outline: none;
    border-color: var(--active-color);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.copy-address-btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--active-color), #00ff00);
    color: var(--base-bg);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 255, 0, 0.3);
}

.copy-address-btn:hover {
    background: linear-gradient(135deg, #00ff00, var(--active-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.5);
}

.copy-address-btn:active {
    transform: translateY(0);
}

/* QR-код */
.qr-code-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

.qr-code-canvas {
    max-width: 200px;
    max-height: 200px;
    border: 2px solid var(--active-color);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

/* Инструкции */
.crypto-instructions {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    line-height: 1.4;
}

/* Адаптивность для крипто */
@media (max-width: 480px) {
    .payment-methods {
        flex-direction: column;
    }
    
    .crypto-payment-details {
        padding: 15px;
    }
    
    .crypto-amount-value {
        font-size: 20px;
    }
    
    .address-display {
        flex-direction: column;
    }
    
    .crypto-address-input {
        font-size: 11px;
    }
    
    .qr-code-canvas {
        max-width: 180px;
        max-height: 180px;
    }
} 

/* Стили для Telegram Wallet формы */
.telegram-wallet-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    margin: 10px 0 0 0;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    width: auto;
    position: relative;
    z-index: 2500; /* чтобы выпадение селекта было видно поверх других слоёв */
}

.telegram-wallet-form .wallet-currency {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

.telegram-wallet-form .wallet-currency:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0,123,255,0.2);
}

.telegram-wallet-form .telegram-wallet-btn {
    width: auto;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* Ограничиваем ширину большого .donate-btn внутри этой формы */
.telegram-wallet-form .donate-btn {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Скрываем устаревший отдельный telegram-wallet-btn если он ещё где-то присутствует */
.telegram-wallet-btn {
    display: none !important;
}

/* Стили для unified селектора валют */
.unified-currency-selector {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 8px 0;
}
.unified-currency-selector .unified-currency-select {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.08);
    min-width: 120px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    z-index: 3000;
}

/* раскрытие списка не перекрывается другими блоками */
.unified-currency-selector { position: relative; z-index: 3000; }

/* Скрываем legacy селектор криптовалют если он ещё есть */
.crypto-currency-selector {
    display: none !important;
}