/* 1. Задний фон-затемнение с размытием */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Полупрозрачный черный */
    backdrop-filter: blur(4px);    /* Эффект размытия заднего плана */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;                  /* Поверх всех остальных элементов */
    animation: fadeIn 0.2s ease-out;
}

/* 2. Само модальное окно */
.profile-modal {
    backdrop-filter: blur(3px);    /* Эффект размытия заднего плана */
    border: 1px solid #2f2f37;      /* Тонкая аккуратная граница */
    border-radius: 16px;
    padding: 80px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;               /* Прокрутка, если экран маленький */
    color: #f4f4f6;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: scaleUp 0.2s ease-out;
}

/* 3. Кнопка закрытия (крестик) */
.profile-modal .close-btn {
    position: absolute;
    top: 75px;
    right: 20px;
    background: transparent;
    border: none;
    color: #a1a1aa;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.profile-modal .close-btn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* Заголовки */
.profile-modal h2 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.profile-modal h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 500;
    color: #a1a1aa;
}

/* Разделительные линии */
.profile-modal hr {
    border: 0;
    border-top: 1px solid #2f2f37;
    margin: 24px 0;
}

/* 4. Поля ввода и группы */
.profile-modal .input-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.profile-modal .input-group label {
    font-size: 13px;
    color: #a1a1aa;
    margin-bottom: 6px;
}

.profile-modal .input-group input {
    background: #222227;
    border: 1px solid #2f2f37;
    border-radius: 8px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-modal .input-group input:focus {
    border-color: #3b82f6; /* Синий фокус */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 5. Кнопки сохранения */
.profile-modal .btn-save {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s, transform 0.1s;
}

.profile-modal .btn-save:hover {
    background: #2563eb;
}

.profile-modal .btn-save:active {
    transform: scale(0.98);
}

/* 6. Уведомления об успехе/ошибке в модалке */
.modal-msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.modal-msg.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.modal-msg.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
/* Секция Telegram-интеграции */
.tg-linked-badge {
    display: flex;
    align-items: center;
    background: #222227;
    border: 1px solid #2f2f37;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.tg-linked-badge .tg-icon {
    font-size: 28px;
    margin-right: 16px;
}

.tg-linked-badge .tg-info {
    display: flex;
    flex-direction: column;
}

.tg-linked-badge .tg-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.tg-linked-badge .tg-username {
    font-size: 13px;
    color: #3b82f6; /* Красивый синий цвет Telegram */
    margin: 0;
}

#tg-login-button {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}
/* Настройки скроллбара для модального окна (для Chrome, Safari, Edge, Opera) */
.profile-modal::-webkit-scrollbar {
    width: 8px; /* Ширина полосы прокрутки */
}

.profile-modal::-webkit-scrollbar-track {
    background: #18181c; /* Цвет дорожки (совпадает с фоном модалки) */
    border-radius: 0 16px 16px 0; /* Скругляем правые углы, чтобы они не вылезали за границы модалки */
}

.profile-modal::-webkit-scrollbar-thumb {
    background: #2f2f37; /* Цвет самого бегунка */
    border-radius: 20px; /* Делаем его круглым */
    border: 2px solid #18181c; /* Создает красивый внутренний отступ */
}

.profile-modal::-webkit-scrollbar-thumb:hover {
    background: #3b82f6; /* При наведении скроллбар становится синим */
}

/* Настройки для Firefox */
.profile-modal {
    scrollbar-width: thin;
    scrollbar-color: #2f2f37 #18181c;
}