
/* Исправление для фона контента статистики в модальном окне */
.statistics-content, .stats-content-container {
    background-color: #1e1e1e !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Обеспечение правильного отображения модального окна */
#channel-stats-modal .bg-gradient-to-b {
    background-color: #252525;
    background-image: linear-gradient(to bottom, #252525, #1e1e1e);
}

/* Улучшенное размытие фона для модального окна */
#channel-stats-modal .backdrop-blur-xl {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Стили для вкладок статистики */
.stats-tab-btn {
    position: relative;
    transition: all 0.3s ease;
    border-bottom: none !important; /* Принудительно убираем border-bottom по умолчанию */
    outline: none !important;
}

.stats-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #3b82f6;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
}

.stats-tab-btn:hover::after {
    width: 40%;
    opacity: 0.5;
}

.stats-tab-btn.tab-active::after {
    width: 100%;
    opacity: 1;
}

/* Удаляем все лишние бордеры */
.stats-tab-btn, 
.stats-tab-btn.active, 
.stats-tab-btn.text-blue-400 {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* CSS-переменные для управления состоянием псевдоэлемента из JavaScript */
.stats-tab-btn {
    --after-width: 0;
    --after-opacity: 0;
}

/* Только активная вкладка должна иметь эффект */
.stats-tab-btn.tab-active {
    --after-width: 100%;
    --after-opacity: 1;
}

.stats-tab-btn.tab-active::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 50% !important;
    width: var(--after-width) !important;
    height: 2px !important;
    background-color: #3b82f6 !important;
    transform: translateX(-50%) !important;
    opacity: var(--after-opacity) !important;
    transition: all 0.3s ease !important;
}

/* Дополнительное переопределение для неактивных вкладок */
.stats-tab-btn:not(.tab-active)::after {
    content: '' !important;
    width: 0 !important;
    opacity: 0 !important;
    height: 0 !important;
}

/* Анимация перехода между вкладками */
.stats-tab-content {
    transition: opacity 0.3s ease;
}

/* Анимация появления контента */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-in-out;
}

/* Стили для панели управления периодом */
.stats-period-controls {
    border-radius: 9999px;
    background-color: #2a2a2a;
    padding: 3px;
    display: inline-flex;
    margin-bottom: 1rem;
}

.stats-period-btn {
    transition: all 0.3s ease;
    border-radius: 9999px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.stats-period-btn:hover {
    color: #3b82f6;
}

/* Стили для блюра фона при открытом модальном окне */
#channel-stats-modal .bg-black\/85 {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Улучшенные стили для контейнера вкладок */
.stats-content-container {
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: 60vh;
    background-color: #1e1e1e !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Предотвращение скролла основного модального окна */
#channel-stats-modal .bg-gradient-to-b {
    max-height: 90vh;
    overflow-y: hidden;
}

/** 0.3s ease;
}

/* Улучшенные стили для контейнера вкладок */
.stats-content-container {
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: 60vh;
    height: auto !important;
}

/* Предотвращение скролла основного модального окна и установка максимальной высоты */
#channel-stats-modal .bg-gradient-to-b {
    max-height: 90vh;
    overflow-y: hidden;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Исправления для модального окна */
#channel-stats-modal {
    z-index: 50;
}

/* Добавляем прокрутку для вкладок с контентом */
.stats-tab-content {
    height: auto;
    overflow-y: visible;
    padding-bottom: 20px;
}

/* Затемненный фон модального окна */
#channel-stats-modal .backdrop-blur-xl {
    cursor: pointer;
}

/**
 * Fixes - Исправления и корректировки стилей
 * 
 * Файл с исправлениями и оверрайдами для восстановления дизайна
 * после проблем с API-ключами и загрузкой аватаров.
 */

/* === Общие исправления === */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* === Исправления для Header === */
header {
    background-color: #252525 !important;
    padding: 1rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo-subtitle {
    margin-left: 0.5rem;
    color: #a0a0a0;
    font-size: 0.875rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.points-indicator {
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.points-icon {
    color: #ffc107;
    margin-right: 0.5rem;
}

.points-value {
    color: #ffc107;
    font-weight: 500;
}

.notification-indicator {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2a2a2a;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notification-indicator:hover {
    background-color: #333333;
}

.notification-indicator i {
    color: #d1d5db;
}

.notification-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background-color: #f44336;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    margin-right: 0.75rem;
    background-color: #2a2a2a;
    overflow: hidden;
}

.user-name {
    color: #d1d5db;
    margin-right: 0.5rem;
}

/* === Исправления для Navbar (Tabs) === */
.tabs-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.tabs {
    display: flex;
    background-color: #252525;
    border-radius: 9999px;
    padding: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    color: #9ca3af;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tab:hover {
    color: #d1d5db;
}

.tab-active {
    background-color: #535353;
    color: white;
}

/* === Исправления для карточек === */
.card {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-body {
    margin-bottom: 1rem;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

/* === Исправления для task-card === */
.task-card {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.channel-info {
    display: flex;
    align-items: center;
}

.channel-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    margin-right: 1rem;
    overflow: hidden;
    background-color: #2a2a2a;
}

.channel-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.subscribers-count {
    color: #9ca3af;
    font-size: 0.875rem;
}

.task-reward {
    display: flex;
    align-items: center;
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}

.task-reward i {
    margin-right: 0.25rem;
}

.task-description {
    color: #9ca3af;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-difficulty {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

.task-difficulty i {
    margin-right: 0.25rem;
    color: #4a90e2;
}

.task-button {
    background-color: #535353;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.task-button:hover {
    background-color: #636363;
}

.task-button.completed {
    background-color: #4caf50;
}

.task-button.skipped {
    background-color: #9e9e9e;
}

/* === Исправления для модальных окон === */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #3a3a3a;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

/* === Исправления для кнопок === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #535353;
    color: white;
}

.btn-primary:hover {
    background-color: #636363;
}

.btn-secondary {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background-color: #333333;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #3d8b40;
}

/* === Исправления для форм === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    color: #e0e0e0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4a90e2;
}

.form-text {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

/* === Исправления для канала === */
.channel-card {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.channel-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.channel-verified {
    color: #4a90e2;
    margin-left: 0.5rem;
}

.channel-description {
    color: #9ca3af;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.channel-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.channel-stat {
    display: flex;
    align-items: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

.channel-stat i {
    margin-right: 0.25rem;
}

.channel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

/* === Исправления для профиля === */
.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 8rem;
    height: 8rem;
    border-radius: 9999px;
    margin-right: 2rem;
    overflow: hidden;
    background-color: #2a2a2a;
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-name {
    color: #9ca3af;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-stat-card {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.profile-stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-stat-label {
    color: #9ca3af;
}

.profile-level {
    background-color: #252525;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
}

.level-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.level-title {
    font-weight: 500;
}

.level-progress-bar {
    height: 0.75rem;
    background-color: #2a2a2a;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.level-progress-fill {
    height: 100%;
    background-color: #4a90e2;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.xp-info {
    display: flex;
    justify-content: space-between;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* === Исправления для уведомлений === */
.notifications-popup {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background-color: #252525;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(156, 163, 175, 0.2) #3a3a3a;
    z-index: 30;
    overflow: hidden;
    display: none;
}

.notification-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

.notification-title {
    font-weight: 500;
}

.notification-count {
    color: #9ca3af;
    font-size: 0.875rem;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #3a3a3a;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #2a2a2a;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: rgba(74, 144, 226, 0.1);
}

.notification-message {
    margin-bottom: 0.25rem;
}

.notification-date {
    color: #9ca3af;
    font-size: 0.75rem;
}

.notification-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid #3a3a3a;
}

.notification-footer a {
    color: #4a90e2;
    text-decoration: none;
}

.notifications-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.notifications-title {
    font-size: 1.5rem;
    font-weight: 600;
}

.notifications-actions {
    display: flex;
    gap: 0.75rem;
}

/* === Исправления для пагинации === */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 0.25rem;
    border-radius: 0.375rem;
    background-color: #2a2a2a;
    color: #e0e0e0;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.pagination-item:hover {
    background-color: #333333;
}

.pagination-item.active {
    background-color: #535353;
    color: white;
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Дополнительные исправления === */
body {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

a {
    color: inherit;
    text-decoration: none;
}

.text-primary {
    color: #535353 !important;
}

.text-success {
    color: #4caf50 !important;
}

.text-danger {
    color: #f44336 !important;
}

.text-warning {
    color: #ff9800 !important;
}

.text-info {
    color: #4a90e2 !important;
}

.bg-primary {
    background-color: #535353 !important;
}

.bg-success {
    background-color: #4caf50 !important;
}

.bg-danger {
    background-color: #f44336 !important;
}

.bg-warning {
    background-color: #ff9800 !important;
}

.bg-info {
    background-color: #4a90e2 !important;
}

/* Затемненный фон для лоадера */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(17, 17, 17, 0.3);
    border-left-color: rgba(156, 163, 175, 0.2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Полупрозрачный оверлей для неактивных элементов */
.disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.disabled-message {
    background-color: #252525;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Устранение конфликтов Tailwind и Bootstrap */
button, input, select, textarea {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
}

/* Исправления для мобильных устройств */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-actions {
        margin-top: 0.75rem;
        width: 100%;
        justify-content: flex-end;
    }
    
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .profile-info {
        text-align: center;
    }
    
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tabs {
        width: 100%;
    }
    
    .channel-card, 
    .task-card {
        flex-direction: column;
    }
    
    .channel-actions, 
    .task-footer {
        flex-wrap: wrap;
    }
    
    .task-button, 
    .channel-action-button {
        width: 100%;
        margin-top: 0.5rem;
    }
}