* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.navbar {
    background: linear-gradient(135deg, #0a1929 0%, #1a2332 100%);
    padding: 12px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.logo a {
    color: #38bdf8;
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    display: inline-block;
}

.logo a:hover {
    transform: scale(1.05);
    color: #7dd3fc;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.8);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-direction: row;
}

/* Стили для колокольчика уведомлений */
.notification-bell {
    position: relative;
    flex-shrink: 0;
}

.bell-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.bell-link:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.4);
}

.bell-link:active {
    transform: translateY(0);
}

.bell-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
    transition: transform 0.3s ease;
}

.bell-link:hover .bell-icon {
    animation: ring 0.5s ease-in-out;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70% { transform: rotate(15deg); }
    20%, 40%, 60% { transform: rotate(-15deg); }
    80% { transform: rotate(8deg); }
    90% { transform: rotate(-8deg); }
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: #0a1929;
    border-radius: 20px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a1929;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-badge.show {
    opacity: 1;
    transform: scale(1);
}

.notification-badge.hidden {
    opacity: 0;
    transform: scale(0);
}

/* Стили для меню пользователя */
.user-menu {
    position: relative;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    background: rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.user-info:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.4);
}

.user-info:active {
    transform: translateY(0);
}

.user-icon {
    width: 38px;
    height: 38px;
    background: rgba(56, 189, 248, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    border: 2px solid rgba(56, 189, 248, 0.3);
    position: relative;
    flex-shrink: 0;
}

.user-icon svg {
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.8));
}

.user-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    z-index: -1;
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

.user-name {
    color: #e0f2fe;
    font-size: 15px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    white-space: nowrap;
}

.dropdown-arrow {
    color: #7dd3fc;
    font-size: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.9;
    flex-shrink: 0;
}

.user-info.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: linear-gradient(135deg, #0f2439 0%, #1a2f45 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #0f2439 0%, #1a2f45 100%);
    transform: rotate(45deg);
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    border-left: 1px solid rgba(56, 189, 248, 0.2);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    padding: 14px 20px;
    color: #e0f2fe;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.dropdown-item:hover::before {
    transform: scaleY(1);
}

.dropdown-item:hover {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.15) 0%, transparent 100%);
    padding-left: 24px;
    color: #7dd3fc;
}

.dropdown-item.logout {
    color: #fca5a5;
    border-top: 1px solid rgba(56, 189, 248, 0.1);
}

.dropdown-item.logout::before {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

.dropdown-item.logout:hover {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.15) 0%, transparent 100%);
    color: #fca5a5;
}

/* Кнопки авторизации */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-btn {
    padding: 10px 24px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(10px);
    border-color: rgba(56, 189, 248, 0.2);
}

.login-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
    border-color: rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.login-btn:hover::before {
    opacity: 1;
}

.register-btn {
    color: #0a1929;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.register-btn:hover {
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(56, 189, 248, 0.6);
}

.register-btn:active,
.login-btn:active {
    transform: translateY(0);
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Планшеты и средние экраны (768px - 1024px) */
@media (max-width: 1024px) {
    .navbar {
        padding: 12px 30px;
    }

    .logo a {
        font-size: 24px;
    }
}

/* Планшеты и мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 20px;
    }

    .navbar-right {
        gap: 10px;
    }

    .logo a {
        font-size: 22px;
    }

    /* Скрываем имя пользователя */
    .user-name {
        display: none;
    }

    /* Скрываем стрелку выпадающего меню */
    .dropdown-arrow {
        display: none;
    }

    /* Адаптация кнопки пользователя */
    .user-info {
        padding: 6px;
        gap: 0;
    }

    /* Уменьшаем размер иконки пользователя */
    .user-icon {
        width: 36px;
        height: 36px;
    }

    /* Уменьшаем размер колокольчика */
    .bell-link {
        width: 40px;
        height: 40px;
    }

    .bell-icon {
        font-size: 20px;
    }

    /* Адаптация кнопок авторизации */
    .auth-buttons {
        gap: 8px;
    }

    .auth-btn {
        padding: 9px 18px;
        font-size: 13px;
        border-radius: 10px;
    }

    /* Адаптация выпадающего меню */
    .dropdown-menu {
        min-width: 200px;
        right: -10px;
    }

    .dropdown-menu::before {
        right: 15px;
    }
}

/* Мобильные устройства (до 576px) */
@media (max-width: 576px) {
    .navbar {
        padding: 10px 15px;
    }

    .navbar-right {
        gap: 8px;
    }

    .logo a {
        font-size: 20px;
    }

    /* Еще больше уменьшаем элементы */
    .user-icon {
        width: 34px;
        height: 34px;
    }

    .bell-link {
        width: 38px;
        height: 38px;
    }

    .bell-icon {
        font-size: 18px;
    }

    .notification-badge {
        font-size: 10px;
        min-width: 18px;
        height: 18px;
        padding: 2px 6px;
        top: -3px;
        right: -3px;
    }

    /* Кнопки авторизации */
    .auth-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Выпадающее меню */
    .dropdown-menu {
        min-width: 180px;
        border-radius: 12px;
    }

    .dropdown-item {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Очень маленькие устройства (до 400px) */
@media (max-width: 400px) {
    .navbar {
        padding: 8px 12px;
    }

    .navbar-right {
        gap: 6px;
    }

    .logo a {
        font-size: 18px;
    }

    /* Минимальные размеры */
    .user-icon {
        width: 32px;
        height: 32px;
        border: 1.5px solid rgba(56, 189, 248, 0.3);
    }

    .bell-link {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .bell-icon {
        font-size: 16px;
    }

    .notification-badge {
        font-size: 9px;
        min-width: 16px;
        height: 16px;
        padding: 2px 5px;
    }

    /* Скрываем кнопку регистрации, оставляем только вход */
    .register-btn {
        display: none;
    }

    .auth-btn {
        padding: 7px 14px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* Компактное выпадающее меню */
    .dropdown-menu {
        min-width: 160px;
        border-radius: 10px;
        right: 0;
    }

    .dropdown-menu::before {
        width: 10px;
        height: 10px;
        right: 12px;
    }

    .dropdown-item {
        padding: 10px 14px;
        font-size: 12px;
        gap: 8px;
    }
}

/* Убираем эффекты hover на сенсорных устройствах */
@media (hover: none) and (pointer: coarse) {
    .bell-link:hover,
    .user-info:hover,
    .login-btn:hover,
    .register-btn:hover {
        transform: none;
    }

    .bell-link:hover .bell-icon {
        animation: none;
    }

    .logo a:hover {
        transform: none;
    }
}

/* Оптимизация для устройств с маленькой высотой экрана */
@media (max-height: 600px) {
    .navbar {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .dropdown-menu {
        max-height: 400px;
        overflow-y: auto;
    }
}

/* Адаптация для ландшафтной ориентации мобильных устройств */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 8px 20px;
    }

    .bell-link,
    .user-info {
        height: 36px;
    }

    .user-icon {
        width: 30px;
        height: 30px;
    }
}