/* ===================================== */
/*          USER SIDEBAR STYLES          */
/* ===================================== */

/* Основной сайдбар */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

/* Стилизация скролла */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* Логотип */
.logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 30px 0 40px 20px;
    cursor: pointer;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 2px;
}

/* Поиск */
.search-box {
    position: relative;
    margin: 0 16px 30px 16px;
}

#searchInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 15px 12px 40px;
    border-radius: 40px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

#searchInput:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
    pointer-events: none;
}

/* Навигационное меню */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    padding: 12px 16px;
    border-radius: 40px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.nav-item.active:hover {
    transform: none;
    filter: brightness(1.05);
}

.nav-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

/* Бейдж (счетчик) */
.nav-badge {
    background: #FFD700;
    color: #000;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-left: auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-item.active .nav-badge {
    background: #000;
    color: #FFD700;
}

/* Кнопка выхода */
.nav-item.logout {
    margin-top: auto;
    color: rgba(255, 75, 75, 0.8);
}

.nav-item.logout:hover {
    background: rgba(255, 75, 75, 0.1);
    color: #ff6b6b;
}

/* Блок пользователя */
.sidebar-user {
    margin-top: auto;
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Аватарка */
.avatar-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-shrink: 0;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    background-size: cover;
    background-position: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.avatar-wrapper:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.avatar-upload-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #000;
    border: 2px solid var(--bg-main);
    opacity: 0;
    transition: all 0.2s ease;
}

.avatar-wrapper:hover .avatar-upload-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Имя пользователя */
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Адаптив для планшетов */
@media (max-width: 1024px) and (min-width: 769px) {
    .sidebar {
        width: 240px;
    }
    
    .logo {
        font-size: 20px;
        margin: 20px 0 30px 16px;
    }
    
    .nav-item {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .nav-icon {
        font-size: 18px;
        width: 26px;
    }
    
    .sidebar-user {
        padding: 16px;
    }
    
    .avatar-wrapper {
        width: 38px;
        height: 38px;
    }
    
    .user-name {
        font-size: 13px;
    }
}

/* Адаптив для мобилок */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
    }
    
    .logo {
        margin: 20px 0 30px 20px;
    }
    
    .nav-item {
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .nav-icon {
        font-size: 22px;
    }
    
    .sidebar-user {
        padding: 20px;
    }
    
    .avatar-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .user-name {
        font-size: 15px;
    }
}

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

.sidebar .logo,
.sidebar .search-box,
.sidebar .nav-item,
.sidebar .sidebar-user {
    animation: fadeInSidebar 0.4s ease forwards;
    opacity: 0;
}

.sidebar .logo { animation-delay: 0.05s; }
.sidebar .search-box { animation-delay: 0.1s; }
.sidebar .nav-item:nth-child(1) { animation-delay: 0.15s; }
.sidebar .nav-item:nth-child(2) { animation-delay: 0.2s; }
.sidebar .nav-item:nth-child(3) { animation-delay: 0.25s; }
.sidebar .nav-item:nth-child(4) { animation-delay: 0.3s; }
.sidebar .nav-item:nth-child(5) { animation-delay: 0.35s; }
.sidebar .nav-item:nth-child(6) { animation-delay: 0.4s; }
.sidebar .sidebar-user { animation-delay: 0.45s; }
/* Счётчики у пунктов меню не нужны */
.nav-badge {
    display: none !important;
}

/* Логотип: контур, который плавно заливается при наведении */
.logo {
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    -webkit-text-stroke: 1.5px #ffd700;
    position: relative;
    display: inline-block;
}

.logo::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: #ffd700;
    -webkit-text-fill-color: #ffd700;
    -webkit-text-stroke: 0;
    white-space: nowrap;
    pointer-events: none;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.45s ease;
}

.logo:hover::before {
    clip-path: inset(0 0 0 0);
}

@media (max-width: 768px) {
    .logo::before {
        display: none;
    }

    .logo {
        -webkit-text-stroke: 1.4px #ffd700;
        color: transparent !important;
        -webkit-text-fill-color: transparent !important;
    }
}

/* Тап по логотипу на телефоне: быстрая заливка и возврат */
@keyframes logoFill {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@media (max-width: 768px) {
    .logo::before {
        display: block !important;
        clip-path: inset(0 100% 0 0);
    }

    .logo.tap-fill::before {
        animation: logoFill 0.22s ease forwards;
    }

    .logo.tap-fill {
        -webkit-text-fill-color: transparent !important;
    }
}

/* Убираем эмодзи-лупу из поиска */
.search-box::before {
    display: none !important;
    content: none !important;
}

#searchInput {
    padding-left: 15px !important;
}
