/* 
 * Новая независимая шапка TGBooster
 * Адаптивный дизайн для всех устройств
 * Полностью независимый CSS без конфликтов
 */

/* Сброс стилей для шапки */
.new-header {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.new-header *,
.new-header *::before,
.new-header *::after {
    box-sizing: border-box;
}

/* Основные стили шапки */
.new-header {
    background-color: #252525;
    border-bottom: 1px solid #3a3a3a;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
}

.new-header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Левая часть - гамбургер (только мобильные) */
.new-header-left {
    display: flex;
    align-items: center;
    min-width: 50px;
    margin-left: 16px;
}

.new-hamburger {
    display: none;
    background: #2a2a2a;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1001;
}

.new-hamburger:hover {
    background: #333333;
    transform: scale(1.05);
}

.new-hamburger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.new-hamburger i {
    color: #e0e0e0;
    font-size: 18px;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Центральная часть - логотип */
.new-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.new-logo {
    font-family: 'Pacifico', cursive;
    font-size: 24px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.new-logo:hover {
    color: #f0f0f0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Правая часть - баланс и аватар */
.new-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 50px;
    justify-content: flex-end;
    margin-right: 0px;
}

/* Блок баланса */
.new-balance {
    background: #2a2a2a;
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.new-balance i {
    color: #fbbf24;
    font-size: 16px;
}

.new-balance-text {
    color: #fbbf24;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* Аватар с dropdown */
.new-avatar-wrapper {
    position: relative;
}

.new-avatar-button {
    background: #2a2a2a;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-avatar-button:hover {
    background: #333333;
    transform: scale(1.05);
}

.new-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Dropdown меню аватара */
.new-avatar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #252525;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1002;
}

.new-avatar-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.new-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #e0e0e0;
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 14px;
    gap: 12px;
}

.new-dropdown-item:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.new-dropdown-item.danger {
    color: #ef4444;
}

.new-dropdown-item.danger:hover {
    color: #ff6b6b;
}

.new-dropdown-item i {
    font-size: 16px;
    width: 16px;
}

/* Мобильное меню */
.new-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.new-mobile-menu.show {
    opacity: 1;
    visibility: visible;
}

.new-mobile-menu-content {
    background: #252525;
    width: 280px;
    height: 100vh;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100000 !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.new-mobile-menu.show .new-mobile-menu-content {
    transform: translateX(0);
}

.new-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #3a3a3a;
}

.new-mobile-menu-title {
    font-family: 'Pacifico', cursive;
    font-size: 20px;
    color: #ffffff;
}

.new-mobile-menu-close {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.new-mobile-menu-close:hover {
    background: #2a2a2a;
}

.new-mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: #2a2a2a;
    border-radius: 12px;
}

.new-mobile-menu-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
}

.new-mobile-menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.new-mobile-menu-user-info h4 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.new-mobile-menu-user-info p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

.new-mobile-menu-balance {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.new-mobile-menu-balance i {
    color: #fbbf24;
    font-size: 20px;
}

.new-mobile-menu-balance span {
    color: #fbbf24;
    font-weight: 600;
    font-size: 16px;
}

.new-mobile-menu-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.new-mobile-menu-item {
    margin-bottom: 8px;
}

.new-mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 12px;
    font-size: 16px;
}

.new-mobile-menu-link:hover {
    background: #2a2a2a;
    color: #ffffff;
}

.new-mobile-menu-link.danger {
    color: #ef4444;
}

.new-mobile-menu-link.danger:hover {
    color: #ff6b6b;
    background: rgba(239, 68, 68, 0.1);
}

.new-mobile-menu-link i {
    font-size: 18px;
    width: 18px;
}

/* Плавающий колокольчик уведомлений - СКРЫТ (используется новая система) */
.new-floating-notifications {
    display: none !important;
}

.new-notification-button {
    background: linear-gradient(135deg, #535353, #404040);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid #606060;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-notification-button:hover {
    background: linear-gradient(135deg, #606060, #505050);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.new-notification-button:active {
    transform: scale(0.95);
}

.new-notification-button i {
    color: #ffffff;
    font-size: 22px;
}

.new-notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: all 0.3s ease;
    border: 2px solid #1a1a1a;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.new-notification-badge.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Dropdown для уведомлений */
.new-notifications-dropdown {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 2147483644;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.new-notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.new-notifications-dropdown-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid #333333;
    background: #252525;
}

.new-notifications-dropdown-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.new-notifications-dropdown-content {
    max-height: 400px;
    overflow-y: auto;
}

.new-notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s ease;
    cursor: pointer;
}

.new-notification-item:hover {
    background: #252525;
}

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

.new-notification-item.unread {
    background: rgba(83, 83, 83, 0.1);
    border-left: 3px solid #535353;
}

.new-notification-text {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.new-notification-time {
    color: #9ca3af;
    font-size: 12px;
}

.new-notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
}

.new-notifications-empty i {
    font-size: 48px;
    color: #404040;
    margin-bottom: 16px;
    display: block;
}

.new-notifications-empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.new-notifications-empty-subtitle {
    font-size: 14px;
    color: #666666;
}

/* Десктопные уведомления в шапке */
.new-desktop-notifications {
    position: relative;
    display: none;
}

.new-desktop-notification-button {
    background: #2a2a2a;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.new-desktop-notification-button:hover {
    background: #333333;
    transform: scale(1.05);
}

.new-desktop-notification-button i {
    color: #e0e0e0;
    font-size: 18px;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    /* Мобильная версия */
    .new-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .new-header-center {
        justify-content: center;
        flex: 1;
        margin: 0 20px; /* Добавляем отступы, чтобы логотип не налезал */
        text-align: center;
    }

    .new-logo {
        font-size: 18px; /* Уменьшаем размер шрифта для мобильных */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .new-header-right {
        flex-shrink: 0;
        gap: 8px; /* Уменьшаем gap для экономии места */
        margin-right: 16px; /* Добавляем отступ справа для аватарки */
    }

    .new-balance-text {
        font-size: 12px;
    }

    .new-balance {
        padding: 6px 8px; /* Уменьшаем padding */
        min-width: 60px; /* Уменьшаем минимальную ширину */
        font-size: 12px;
    }

    .new-avatar-button,
    .new-hamburger {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .new-floating-notifications {
        display: block;
    }

    .new-desktop-notifications {
        display: none !important;
    }

    /* Мобильное dropdown меню аватара */
    .new-avatar-dropdown {
        right: 0;
        min-width: 180px;
    }

    /* Скрываем навигационное меню под шапкой на мобильных */
    .flex.justify-center.mt-6.mb-10 {
        display: none !important;
    }
}

@media (min-width: 769px) {
    /* Десктопная версия */
    .new-hamburger {
        display: none !important;
    }

    .new-header-center {
        justify-content: flex-start;
        position: static;
        transform: none;
        width: auto;
        flex: none;
    }

    .new-logo {
        font-size: 28px;
    }

    .new-desktop-notifications {
        display: none !important; /* Скрыта - используется новая система */
    }

    .new-floating-notifications {
        display: block !important; /* Показываем на всех устройствах для тестирования */
    }

    .new-header-right {
        gap: 16px;
    }

    .new-balance {
        padding: 10px 16px;
        min-width: 100px;
    }

    .new-balance-text {
        font-size: 14px;
    }
}

@media (min-width: 1024px) {
    /* Широкие экраны */
    .new-header-container {
        padding: 0 24px;
    }

    .new-logo {
        font-size: 32px;
    }

    .new-header-right {
        gap: 20px;
    }
}

/* Анимации */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

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

/* Утилиты */
.new-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Исправление конфликтов z-index - максимальные значения */
.new-header {
    z-index: 999999 !important;
}

.new-mobile-menu {
    z-index: 2147483647 !important;
    position: fixed !important;
}

.new-mobile-menu-content {
    z-index: 2147483647 !important;
    position: fixed !important;
}

.new-avatar-dropdown {
    z-index: 2147483646 !important;
    position: absolute !important;
}

.new-floating-notifications {
    z-index: 2147483645 !important;
}

/* Обеспечиваем, что мобильное меню всегда поверх всего */
.new-mobile-menu.show {
    z-index: 2147483647 !important;
}

.new-mobile-menu.show .new-mobile-menu-content {
    z-index: 2147483647 !important;
}

/* Отключаем прокрутку body при открытом мобильном меню */
body.new-mobile-menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Принудительные стили для мобильного меню */
.new-mobile-menu.show {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, 0.8) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.new-mobile-menu.show .new-mobile-menu-content {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2147483647 !important;
}

/* Дополнительная защита от конфликтов z-index */
.new-mobile-menu * {
    z-index: inherit;
}

/* Убеждаемся, что все остальные элементы имеют низкий z-index */
main, .container, .content, .task-card, .card, .bg-gray-800, .bg-gray-900,
.info-card, .main-content-blocks, .stats-section, .features-grid, 
.bg-primary, .border-primary, button, a, h1, h2, h3, p, div {
    z-index: 1 !important;
    position: relative !important;
}

/* Специальные правила для элементов главной страницы */
.main-content-blocks *, .info-card *, .stats-section *, .features-grid *,
.tabs *, .navigation *, .rounded-button, .bg-\[.+\], .text-.+ {
    z-index: 1 !important;
}

/* Принудительно низкий z-index для всех элементов кроме header и menu */
* {
    z-index: 1 !important;
}

/* Исключения для элементов header */
.new-header, .new-header * {
    z-index: 999999 !important;
}

.new-mobile-menu, .new-mobile-menu * {
    z-index: 2147483647 !important;
}

.new-avatar-dropdown, .new-avatar-dropdown * {
    z-index: 2147483646 !important;
}

.new-floating-notifications, .new-floating-notifications * {
    z-index: 2147483645 !important;
}

/* Принудительная изоляция стилей */
.new-header {
    all: initial;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    background-color: #252525 !important;
    border-bottom: 1px solid #3a3a3a !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    width: 100% !important;
    min-height: 70px !important;
    display: flex !important;
    align-items: center !important;
}

/* Отступ под хедером */
.header-spacing {
    margin-top: 10px; /* Уменьшенный отступ для ПК */
}

@media (max-width: 768px) {
    .header-spacing {
        margin-top: 70px; /* Отступ для мобильных остается */
    }
}