/* ==========================================================================
   МОДАЛЬНОЕ ОКНО ПОДДЕРЖКИ - ГАРМОНИЧНЫЙ ДИЗАЙН
   ========================================================================== */

/* Основные цвета для модального окна */
:root {
    --accent-gold: #d4af37;
    --accent-gold-light: #e6c158;
    --accent-gold-dark: #b8941f;
    --accent-gold-very-light: #f8f3e6;
    --modal-bg: #ffffff;
    --modal-border: #e1e8ed;
    --modal-text: #2c3e50;
    --modal-text-secondary: #7f8c8d;
    --modal-shadow: rgba(0, 0, 0, 0.1);
    --success-green: #27ae60;
    --telegram-blue: #0088cc;
}

/* Кнопка поддержки */
#support-project-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    border: none;
    border-radius: 50px;
    width: auto;
    height: 50px;
    cursor: pointer;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    padding: 0 25px;
    gap: 10px;
    min-width: 50px;
    overflow: hidden;
    font-family: inherit;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

#support-project-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
}

#support-project-btn:hover::before {
    left: 100%;
}

#support-project-btn i {
    font-size: 18px;
    transition: all 0.4s ease;
    z-index: 1;
}

#support-project-btn .btn-text {
    white-space: nowrap;
    transition: all 0.3s ease;
    z-index: 1;
}

#support-project-btn:hover {
    transform: translateY(-8px) scale(1.05);
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.4);
}

#support-project-btn:hover i {
    transform: rotate(15deg) scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#support-project-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: heartBeat 0.6s ease 0.2s both;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.1); }
    30% { transform: scale(1); }
    45% { transform: scale(1.05); }
    60% { transform: scale(1); }
}

/* Модальное окно */
.support-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(44, 62, 80, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999999;
    animation: modalFadeIn 0.4s ease;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 20px;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        backdrop-filter: blur(0);
    }
    to { 
        opacity: 1; 
        backdrop-filter: blur(8px);
    }
}

.support-modal-content {
    position: relative;
    background: var(--modal-bg);
    padding: 35px 30px 30px;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--modal-shadow);
    animation: modalSlideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--modal-border);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transform-origin: center;
    overflow: hidden;
}

.support-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

@keyframes modalSlideUp {
    from { 
        transform: translateY(50px) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

/* Кнопка закрытия */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid var(--modal-border);
    border-radius: 50%;
    font-size: 18px;
    color: var(--modal-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
    transform: rotate(90deg) scale(1.1);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ==========================================================================
   ПРЕКРАСНЫЙ СКРОЛЛБАР - ГАРМОНИЧНЫЙ С ДИЗАЙНОМ
   ========================================================================== */

/* Контейнер для содержимого с продвинутым скроллбаром */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-right: -4px;
    /* Для Firefox - современный тонкий скроллбар */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) var(--accent-gold-very-light);
}

/* Премиум скроллбар для WebKit браузеров (Chrome, Safari, Edge) */
.modal-body::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}

/* Трек скроллбара - гармонирует с фоном модального окна */
.modal-body::-webkit-scrollbar-track {
    background: var(--accent-gold-very-light);
    border-radius: 10px;
    margin: 4px 0;
    border: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.05);
}

/* Ползунок скроллбара - красивый градиентный дизайн */
.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, 
        var(--accent-gold-dark) 0%, 
        var(--accent-gold) 50%, 
        var(--accent-gold-light) 100%);
    border-radius: 10px;
    border: 2px solid var(--accent-gold-very-light);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 40px;
    position: relative;
}

/* Эффект при наведении на ползунок */
.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, 
        var(--accent-gold) 0%, 
        var(--accent-gold-light) 50%, 
        var(--accent-gold) 100%);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 
        inset 0 0 0 1px rgba(255, 255, 255, 0.4),
        0 3px 6px rgba(212, 175, 55, 0.2);
    transform: scaleX(1.05);
}

/* Эффект при активном скролле */
.modal-body::-webkit-scrollbar-thumb:active {
    background: linear-gradient(to bottom, 
        var(--accent-gold-dark) 0%, 
        var(--accent-gold) 100%);
    border-color: rgba(212, 175, 55, 0.4);
}

/* Кнопки на концах скроллбара (верх/низ) */
.modal-body::-webkit-scrollbar-button {
    display: none;
}

/* Угол скроллбара */
.modal-body::-webkit-scrollbar-corner {
    background: transparent;
}

/* Стили для Firefox */
@media screen and (min-width: 768px) {
    .modal-body {
        scrollbar-width: thin;
        scrollbar-color: var(--accent-gold) var(--accent-gold-very-light);
    }
}

/* Заголовок */
.support-modal h2 {
    color: var(--modal-text);
    margin: 0 0 25px 0;
    font-size: 24px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.support-modal h2 i {
    color: var(--accent-gold);
    font-size: 26px;
}

/* Список кошельков - новая структура */
.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
}

.wallet-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-item:hover {
    background: rgba(255 255 255 / 15%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.15);
}

.wallet-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-currency {
    font-weight: 600;
    color: var(--modal-text);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.wallet-currency i {
    color: var(--accent-gold);
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Адрес кошелька */
.wallet-address {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--modal-text-secondary);
    border: 1px solid #e9ecef;
    line-height: 1.5;
    overflow-wrap: break-word;
    transition: all 0.3s ease;
}

.wallet-item:hover .wallet-address {
    border-color: var(--accent-gold);
}

/* Кнопки - новая структура под адресом */
.wallet-item .copy-btn {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    text-decoration: none !important;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.wallet-item .copy-btn:hover {
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

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

.wallet-item .copy-btn.copied {
    background: var(--success-green);
    animation: copiedPulse 0.5s ease;
}

@keyframes copiedPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* Кнопка Telegram */
.wallet-item .copy-btn.telegram-btn {
    background: linear-gradient(135deg, var(--telegram-blue), #34b7f1);
    color: white;
}

.wallet-item .copy-btn.telegram-btn:hover {
    background: linear-gradient(135deg, #34b7f1, var(--telegram-blue));
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.3);
}

/* Футер модального окна */
.modal-footer {
    text-align: center;
    color: var(--modal-text-secondary);
    font-size: 14px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-shrink: 0;
    margin-top: auto;
    font-weight: 500;
}

.modal-footer i {
    color: var(--accent-gold);
    font-size: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Анимация появления элементов */
.wallet-item {
    animation: fadeInUp 0.5s ease backwards;
}

.wallet-item:nth-child(1) { animation-delay: 0.1s; }
.wallet-item:nth-child(2) { animation-delay: 0.2s; }
.wallet-item:nth-child(3) { animation-delay: 0.3s; }
.wallet-item:nth-child(4) { animation-delay: 0.4s; }
.wallet-item:nth-child(5) { animation-delay: 0.5s; }
.wallet-item:nth-child(6) { animation-delay: 0.6s; }

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

/* ==========================================================================
   АДАПТИВНЫЕ СТИЛИ
   ========================================================================== */

@media screen and (max-width: 768px) {
    #support-project-btn {
        bottom: 90px;
        right: 23px;
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
    }
    
    #support-project-btn .btn-text {
        display: none;
    }
    
    #support-project-btn i {
        font-size: 22px;
        margin-right: 0;
    }
    
    .support-modal {
        padding: 15px;
    }
    
    .support-modal-content {
        padding: 25px 20px 20px;
        max-width: 95%;
        max-height: 90vh;
        border-radius: 14px;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .support-modal h2 {
        font-size: 20px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        gap: 10px;
    }
    
    .support-modal h2 i {
        font-size: 22px;
    }
    
    .wallet-list {
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .wallet-item {
        padding: 18px;
        gap: 10px;
    }
    
    .wallet-currency {
        font-size: 15px;
        gap: 10px;
    }
    
    .wallet-address {
        font-size: 13px;
        padding: 12px 14px;
    }
    
    .wallet-item .copy-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .modal-footer {
        padding-top: 20px;
        font-size: 13px;
    }
    
    /* Адаптивный скроллбар для мобильных */
    .modal-body {
        padding-right: 4px;
        margin-right: 0;
    }
    
    .modal-body::-webkit-scrollbar {
        width: 6px;
    }
    
    .modal-body::-webkit-scrollbar-track {
        border-radius: 6px;
        margin: 2px 0;
    }
    
    .modal-body::-webkit-scrollbar-thumb {
        border-width: 1px;
        min-height: 30px;
    }
}

@media screen and (max-width: 480px) {
    #support-project-btn {
        bottom: 90px;
        right: 23px;
        width: 52px;
        height: 52px;
    }
    
    #support-project-btn i {
        font-size: 20px;
    }
    
    .support-modal {
        padding: 10px;
    }
    
    .support-modal-content {
        padding: 22px 16px 18px;
        max-width: 100%;
        margin: 0;
        border-radius: 12px;
        max-height: 85vh;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    
    .support-modal h2 {
        font-size: 18px;
        gap: 8px;
        padding-bottom: 12px;
        margin-bottom: 18px;
    }
    
    .support-modal h2 i {
        font-size: 20px;
    }
    
    .wallet-list {
        gap: 14px;
        margin-bottom: 18px;
    }
    
    .wallet-item {
        padding: 16px;
        gap: 8px;
    }
    
    .wallet-currency {
        font-size: 14px;
        gap: 8px;
    }
    
    .wallet-currency i {
        font-size: 18px;
    }
    
    .wallet-address {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .wallet-item .copy-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .modal-footer {
        padding-top: 18px;
        font-size: 12px;
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .support-modal-content {
        max-width: 90%;
        max-height: 95vh;
        padding: 20px;
    }
    
    .support-modal h2 {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .wallet-list {
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .wallet-item {
        padding: 14px;
        gap: 6px;
    }
    
    .wallet-address {
        padding: 10px;
        font-size: 11px;
    }
    
    .wallet-item .copy-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .modal-footer {
        padding-top: 15px;
        font-size: 12px;
    }
}

/* Для высоких экранов */
@media screen and (min-height: 1000px) {
    .support-modal-content {
        max-height: 75vh;
        max-width: 550px;
    }
}

/* ==========================================================================
   ТЕМНАЯ ТЕМА - АДАПТИРОВАННЫЙ СКРОЛЛБАР
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --modal-bg: #1a1d23;
        --modal-border: #2a2f3a;
        --modal-text: #e4e6eb;
        --modal-text-secondary: #8a8f98;
        --modal-shadow: rgba(0, 0, 0, 0.3);
        --accent-gold-very-light: #2a2a2a;
    }
    
    .wallet-item {
        background: #222831;
        border-color: #2a2f3a;
    }
    
    .wallet-address {
        background: #2a2f3a;
        border-color: #3a3f4a;
        color: #f4f4f4;
    }
    
    /* Адаптация скроллбара для темной темы */
    .modal-body {
        scrollbar-color: var(--accent-gold) #2a2a2a;
    }
    
    .modal-body::-webkit-scrollbar-track {
        background: #2a2a2a;
        border-color: rgba(212, 175, 55, 0.2);
        box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    }
    
    .modal-body::-webkit-scrollbar-thumb {
        border-color: #2a2a2a;
        box-shadow: 
            inset 0 0 0 1px rgba(255, 255, 255, 0.1),
            0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .modal-body::-webkit-scrollbar-thumb:hover {
        border-color: rgba(212, 175, 55, 0.3);
        box-shadow: 
            inset 0 0 0 1px rgba(255, 255, 255, 0.2),
            0 3px 6px rgba(0, 0, 0, 0.4);
    }
    
    .support-modal h2 {
        border-bottom-color: #2a2f3a;
    }
    
    .modal-footer {
        border-top-color: #2a2f3a;
    }
}