/* Стили для всплывающего сообщения */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    z-index: 1000;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Стили для сообщения об истекшей подписке */
.expired-popup {
    display: none;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.expired-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Стили для кнопки "Оплатить" */
.pay-button {
    padding: 10px 20px;
    background-color: #0088cc; /* Фирменный синий цвет Telegram */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pay-button:hover {
    background-color: #006699; /* Темнее синий при наведении */
}

/* Стили для блокировки интерфейса */
.disabled-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    pointer-events: all; /* Блокирует взаимодействие с элементами под оверлеем */
}

/* Стили для сообщения о недоступной функции */
.restricted-popup {
    display: none;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.restricted-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Кнопка "Админка" (компактная) */
.admin-button {
    padding: 6px 12px;
    background-color: #ff5722;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 8px;
    font-weight: bold;
    text-transform: uppercase;
}

.admin-button:hover {
    background-color: #e64a19;
}

/* Стили для кнопок в админке (как в основном интерфейсе) */
.tg-button {
    padding: 10px 20px;
    background-color: #0088cc;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 5px;
}

.tg-button:hover {
    background-color: #006699;
}

/* Общие стили */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

/* Контейнер с фоновой гифкой */
.background-gif {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/background.jpg?v=1.1');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* Шапка */
header {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Контейнер с информацией о пользователе */
.user-info {
    display: flex;
    align-items: center;
}

/* Фото пользователя */
#user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Информация о пользователе */
.user-details {
    color: white;
    font-size: 14px;
}

#user-name, #user-id {
    margin: 0;
    line-height: 1.5;
}

/* Таймер */
.timer {
    color: white;
    font-size: 18px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

/* Стили для блока с информацией о BTC */
.btc-info {
    position: absolute;
    top: 70px; /* Отступ от шапки */
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: red;
    font-size: 18px;
}

/* Стили для круга */
.btc-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: yellow; /* По умолчанию желтый */
}

/* Стили для цены BTC */
.btc-price {
    font-weight: bold;
}

/* Оверлей для блокировки фона */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Стили для блока с кнопками Support и Channel */
.support-container {
    position: absolute;
    top: 170px; /* Отступ от шапки */
    left: 20px;
    display: flex;
    flex-direction: column; /* Кнопки вертикально */
    gap: 10px; /* Отступ между кнопками */
}

/* Стили для кнопок Support и Channel */
.support-button {
    padding: 8px 16px;
    background-color: #0088cc;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100px; /* Фиксированная ширина для выравнивания */
    text-align: center;
}

.support-button:hover {
    background-color: #006699;
}

/* Стили для блока с балансом пользователя - ИСПРАВЛЕННАЯ ВЕРСИЯ */
.user-balance {
    position: absolute;
    top: 120px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 18px;
}

.user-balance-label {
    font-weight: bold;
    color: red; /* Явно задаем белый цвет для метки */
}

/* Анимация переливающихся цветов для суммы баланса с исправлением */
.user-balance-value {
    font-weight: bold;
    display: inline-block; /* Критически важно для анимации */
    background: linear-gradient(90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow 8s linear infinite;
    padding: 0 2px; /* Чтобы градиент лучше отображался */
}

/* Отключаем стандартные состояния, если они мешают */
.user-balance-value.updating,
.user-balance-value.error {
    animation: none;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
}

/* Дополнительные состояния */
.user-balance-value.updating {
    animation: balanceUpdate 0.5s ease;
    color: #0088cc; /* Сохраняем синий при обновлении */
}

.user-balance-value.error {
    color: #f44336; /* Красный для ошибок */
}

.disabled-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    text-align: center;
    padding: 20px;
}

/* Анимация переливающихся цветов для ссылки WEBSITE с подчеркиванием */
.info-link {
    position: absolute;
    top: 160px;
    right: 20px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow 8s ease infinite;
    transition: all 0.3s ease;
    padding-bottom: 2px; /* Отступ для подчеркивания */
    border-bottom: 2px solid transparent;
}

.info-link:hover {
    transform: scale(1.05);
    border-bottom-color: currentColor; /* Подчеркивание цветом текста */
}

/* Общая анимация для переливающихся цветов */
@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Контейнер для API Timer и значения */
.api-timer-container {
    position: absolute;
    top: 190px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Стили для метки API Timer */
.api-timer-label {
    font-size: 16px;
    font-weight: bold;
    color: red;
}

/* Стили для значения API Timer с переливающимся градиентом */
.api-timer-value {
    font-size: 16px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;

    /* Градиентный текст */
    background: linear-gradient(90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rainbow 8s linear infinite;
}

/* Состояния для API Timer */
.api-timer-value.expired {
    /* Сбрасываем анимацию и градиент */
    animation: none;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    /* Устанавливаем цвет напрямую через color */
    color: #ff4444; /* Красный для истекшего срока */
}

.api-timer-value.warning {
    animation: none;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    color: #ff9900; /* Оранжевый для предупреждения */
}

.api-timer-value.error {
    animation: none;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    color: #ff4444; /* Красный для ошибок */
    cursor: pointer; /* Показываем, что можно кликнуть */
}