/* assets/css/header.css — верхняя панель */

.top-bar-enhanced {
    background: rgba(12, 12, 30, 0.92);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
    min-height: 64px;
    position: relative;
}

.top-bar-enhanced::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--accent), var(--primary), transparent);
    background-size: 300% 100%;
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================================
   Левая часть
   ============================================================ */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 24px;
    color: var(--primary-light);
    font-weight: 300;
    line-height: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.5;
}

.header-divider {
    width: 1px;
    height: 32px;
    background: var(--glass-border);
    flex-shrink: 0;
}

.page-title-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.page-title-icon {
    width: 32px;
    height: 32px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 14px;
    flex-shrink: 0;
}

.page-title-main {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.page-title-sub {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.5;
    white-space: nowrap;
    margin-left: 4px;
}

/* ============================================================
   Правая часть
   ============================================================ */
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* ============================================================
   БАЛАНС
   ============================================================ */
.header-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    transition: all 0.1s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.header-balance::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(236, 72, 153, 0.05));
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
}

.header-balance:hover {
    border-color: rgba(124, 58, 237, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

.header-balance:hover::before {
    opacity: 1;
}

.balance-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.balance-icon i {
    font-size: 11px;
    color: #ffffff;
}

.balance-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

.balance-label {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    opacity: 0.5;
    padding-left: 2px;
}

.balance-value.infinite {
    font-size: 18px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ============================================================
   АВАТАР
   ============================================================ */
.header-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

.header-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.25);
}

.header-avatar:active {
    transform: scale(0.95);
}

.header-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    transition: opacity 0.1s ease;
}

.header-avatar:hover::after {
    opacity: 0.6;
}

/* ============================================================
   ИНФОРМАЦИЯ О ПОЛЬЗОВАТЕЛЕ
   ============================================================ */
.header-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: right;
    min-width: 0;
}

.header-user-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.header-user-name .role-badge {
    font-size: 8px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--primary-light);
    border: 1px solid var(--glass-border);
}

.header-user-name .role-badge.founder {
    background: rgba(251, 191, 36, 0.12);
    color: var(--gold);
    border-color: rgba(251, 191, 36, 0.15);
}

.header-user-name .role-badge.admin {
    background: rgba(236, 72, 153, 0.12);
    color: var(--secondary);
    border-color: rgba(236, 72, 153, 0.15);
}

.header-user-group {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 500;
}

.header-user-title {
    font-size: 9px;
}

.header-user-title .title-badge-display {
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 8px;
}

/* ============================================================
   КНОПКИ
   ============================================================ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.header-action-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 15px;
    padding: 0;
    transition: background 0.1s ease, color 0.1s ease;
}

.header-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.header-action-btn i {
    font-size: 15px;
    line-height: 1;
}

/* Уведомления */
.header-action-btn.notifications-btn .notifications-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: #ffffff;
    font-size: 8px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid var(--bg-dark);
}

/* Переключение темы */
.header-action-btn.theme-toggle-btn .fa-sun {
    display: none;
}

.header-action-btn.theme-toggle-btn .fa-moon {
    display: inline-block;
}

body.light-theme .header-action-btn.theme-toggle-btn .fa-sun {
    display: inline-block;
}

body.light-theme .header-action-btn.theme-toggle-btn .fa-moon {
    display: none;
}

/* Кнопка сезона */
.header-action-btn.season-toggle-btn .fa-tree {
    font-size: 14px;
}

body.season-winter .header-action-btn.season-toggle-btn .fa-tree {
    display: none !important;
}

body.season-winter .header-action-btn.season-toggle-btn .fa-snowflake {
    display: inline-block !important;
}

body.season-spring .header-action-btn.season-toggle-btn .fa-tree {
    display: none !important;
}

body.season-spring .header-action-btn.season-toggle-btn .fa-seedling {
    display: inline-block !important;
}

body.season-summer .header-action-btn.season-toggle-btn .fa-tree {
    display: none !important;
}

body.season-summer .header-action-btn.season-toggle-btn .fa-sun {
    display: inline-block !important;
}

body.season-autumn .header-action-btn.season-toggle-btn .fa-tree {
    display: none !important;
}

body.season-autumn .header-action-btn.season-toggle-btn .fa-leaf {
    display: inline-block !important;
}

/* Кнопка выхода */
.header-action-btn.logout-header-btn {
    color: var(--danger);
}

.header-action-btn.logout-header-btn:hover {
    color: #ffffff;
    background: var(--danger);
}