/* app/assets/css/header.css - стили для верхней панели (исправленная для Яндекс.Браузера) */

/* ============================================ */
/* ВЕРХНЯЯ ПАНЕЛЬ - МИНИМАЛИСТИЧНАЯ */
/* ============================================ */

/* Основная панель */
.navbar-main {
    height: var(--header-height);
    background: var(--gradient-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    padding: 0;
    box-shadow: 0 4px 20px rgba(67, 97, 238, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* backdrop-filter и -webkit-backdrop-filter убраны для совместимости */
}

/* Контейнер содержимого */
.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
    max-width: 100%;
    margin: 0 auto;
}

/* Левая часть: логотип */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
}

.navbar-brand:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.08);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Упрощенная анимация для совместимости */
.logo-icon:hover {
    transform: scale(1.05);
    background: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 1.4rem;
    color: white;
    line-height: 1;
    letter-spacing: -0.5px;
    position: relative;
    padding-right: 0.25rem;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-top: 3px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Центральная часть: быстрый доступ */
.quick-access {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    margin-right: 1.5rem;
}

.quick-access-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.quick-access-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.quick-access-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.quick-access-btn .tooltip-text {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-access-btn .tooltip-text::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.85) transparent;
}

.quick-access-btn:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(5px);
}

/* Правая часть: действия */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Уведомления */
.notification-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    overflow: visible !important;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

/* ИСПРАВЛЕННЫЙ БЕЙДЖ УВЕДОМЛЕНИЙ */
.notification-badge {
    position: absolute;
    top: -8px !important;
    right: -8px !important;
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%) !important;
    color: white !important;
    font-weight: 900 !important;
    font-size: 0.65rem !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 3px solid white !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    animation: badgePulse 1.5s infinite !important;
    z-index: 10 !important;
    line-height: 1 !important;
    padding: 0 !important;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Выпадающее меню уведомлений */
.notification-dropdown {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    background: white;
}

.notification-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.notification-clear {
    font-size: 0.75rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.notification-clear:hover {
    color: var(--primary-dark);
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--gray-50);
}

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

.notification-item.unread {
    background: rgba(67, 97, 238, 0.05);
}

.notification-item.unread:hover {
    background: rgba(67, 97, 238, 0.08);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.notification-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notification-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.notification-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.notification-footer a {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.notification-footer a:hover {
    color: var(--primary-dark);
}

/* Профиль пользователя */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    border-radius: 50px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--gradient-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.user-profile:hover .user-avatar {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.97);
    margin-top: 3px;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.user-dropdown-icon {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    margin-left: 0.25rem;
    transition: var(--transition);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.user-profile:hover .user-dropdown-icon {
    color: white;
    transform: translateY(1px);
}

/* Выпадающее меню пользователя */
.user-dropdown {
    min-width: 220px;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    background: white;
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.user-dropdown-header h6 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-800);
}

.user-dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-700);
    text-decoration: none;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--gray-600);
}

.user-dropdown-item:hover i {
    color: var(--primary);
}

.user-dropdown-divider {
    margin: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.user-dropdown-item.danger {
    color: var(--danger);
}

.user-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.user-dropdown-item.danger i {
    color: var(--danger);
}

/* Кнопка меню для мобильных */
.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

/* Поиск (скрыт по умолчанию) */
.search-container {
    display: none;
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 3rem;
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.9);
}

/* Темный режим поддержка */
/*@media (prefers-color-scheme: dark) {
    .notification-dropdown,
    .user-dropdown {
        background: var(--gray-900);
        border-color: var(--gray-700);
    }
    
    .notification-item:hover {
        background: var(--gray-800);
    }
    
    .notification-item.unread {
        background: rgba(67, 97, 238, 0.15);
    }
    
    .notification-item.unread:hover {
        background: rgba(67, 97, 238, 0.2);
    }
    
    .user-dropdown-item:hover {
        background: var(--gray-800);
    }
    
    .user-dropdown-item.danger:hover {
        background: rgba(239, 68, 68, 0.2);
    }
    
    .user-name {
        color: white;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    }
    
    .user-role {
        color: rgba(255, 255, 255, 0.95);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    }
}*/

/* Мобильная адаптация */
@media (max-width: 992px) {
    .navbar-content {
        padding: 0 1rem;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-text {
        display: none;
    }
    
    .quick-access {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .user-profile {
        padding: 0.25rem;
    }
    
    .search-container {
        display: none;
    }
    
    .user-name,
    .user-role {
        color: white;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

@media (max-width: 768px) {
    .notification-btn {
        width: 44px;
        height: 44px;
    }
    
    .notification-badge {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
        font-weight: 900;
        border-width: 2.5px;
        top: -5px;
        right: -5px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .navbar-actions {
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .notification-btn {
        display: flex;
    }
    
    .user-profile {
        padding: 0.125rem;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-width: 2px;
    }
    
    .user-dropdown-icon {
        display: none;
    }
}

/* Анимация появления */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-main {
    animation: slideDown 1s ease-out;
}

/* Эффект волны при клике */
.wave-effect {
    position: relative;
    overflow: hidden;
}

.wave-effect:focus:not(:active)::after {
    animation: wave 0.6s ease-out;
}

@keyframes wave {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(30, 30);
        opacity: 0;
    }
}

/* Индикатор загрузки для кнопок */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

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

/* Состояния кнопок */
.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading .loading-spinner {
    display: inline-block;
}

/* Активное состояние для кнопок быстрого доступа */
.quick-access-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Улучшение видимости бейджа */
.notification-badge::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.3) 0%, 
        rgba(217, 119, 6, 0.3) 100%);
    z-index: -1;
    animation: badgeGlow 2s infinite;
}

@keyframes badgeGlow {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Специальные исправления для проблемных браузеров */
body.problematic-browser .navbar-main {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%) !important;
}

body.problematic-browser .user-name,
body.problematic-browser .user-role {
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

body.problematic-browser .logo-title {
    color: white !important;
    background: none !important;
}

body.problematic-browser .dropdown-menu {
    background: white !important;
    border: 1px solid #dee2e6 !important;
}

body.problematic-browser .notification-badge {
    background: #f72585 !important;
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%) !important;
    border: 2px solid white !important;
}

/* Улучшение для всех браузеров */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Гарантированная видимость текста */
.user-name,
.user-role,
.logo-title {
    color: white !important;
}

/* Гарантированный фон для dropdown */
.dropdown-menu {
    background: white !important;
    border: 1px solid #dee2e6 !important;
}