/* ==================== NAVBAR STYLING ==================== */
#mainNav {
    
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', sans-serif;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    z-index: 1050;
}

/* BRAND */
#mainNav .navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

label[for="navbar-toggler-icon"]{
    font-size: 12px;
    font-weight: 600;
    color: #383838;
    cursor: pointer;
}

#mainNav {

    transition: transform 0.4s ease; /* анимируем transform */
}
/* Мобильная версия */
@media (max-width: 768px) {
    #mainNav.nav-hidden {
        transform: translateY(-120%); /* уезжает плавно */
    }

    #mainNav.nav-show-bounce {
        animation: bounceDown 0.6s cubic-bezier(0.25, 1.25, 0.5, 1.0);
    }

    @keyframes bounceDown {
        0% { transform: translateY(-120%); }
        60% { transform: translateY(10%); }
        80% { transform: translateY(-5%); }
        100% { transform: translateY(0); }
    }

    /* Glow при появлении */
    #mainNav.nav-glow {
        box-shadow: 0 0 20px rgba(0, 255, 200, 0.6), 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}

/* BRAND ICON */
#mainNav .bs-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #dee2e6;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#mainNav .bs-icon:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* NAV LINKS */
#mainNav .navbar-nav .nav-link {
    color: #212529 !important; /* тёмный текст */
    font-weight: 500;
    margin: 0 10px;
    padding: 10px 16px;
    border-radius: 14px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

/* ACTIVE LINK - СЕРЕБРО */
#mainNav .navbar-nav .nav-link.active {
    background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
    color: #fff; /* текст на активном пункте можно сделать белым для контраста */
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

#mainNav .icon-button.active{
    background: linear-gradient(135deg, #c0c0c0, #c4c3c3) !important;
   color: #212529 !important; /* текст на активном пункте можно сделать белым для контраста */
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08) !important;
}

/* HOVER LINKS */
#mainNav .navbar-nav .nav-link:hover {
    background: linear-gradient(145deg, #dcdcdc, #f0f0f0);
    color: #212529;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Модальное окно поиска */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 2000;
}

/* Окно поиска почти на всю ширину, прямо сверху */
.search-modal-content {
    width: 95%;
    max-width: 1200px;
    margin-top: -100px; /* для плавного выезда сверху */
    background: #1f1f1f;
    padding: 20px 30px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    display: flex;
    gap: 10px;
    align-items: center;
    transition: margin-top 0.5s ease, opacity 0.5s ease;
    opacity: 0;
    position: relative;
}

/* Показываем окно */
.search-modal.show .search-modal-content {
    margin-top: 0;
    opacity: 1;
}

/* Поле ввода */
#searchModalInput {
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
}

/* Кнопка поиска */
.search-modal-content button {
    padding: 12px 18px;
    border-radius: 8px;
    border: none;
    background: #c0c0c0;
    color: #212529;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-modal-content button:hover {
    background: #e0e0e0;
}

/* Кнопка закрытия */
.search-modal-content .close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
}


/* TOGGLER */
.navbar-toggler {
    border: none;
    background: linear-gradient(145deg, #e0e0e0, #f1f3f5);
    border-radius: 10px;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.navbar-toggler:hover {
    background: linear-gradient(145deg, #f1f3f5, #e9ecef);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%2820,20,20,0.7%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/ %3E%3C/svg%3E");
}

/* PROFILE & ICON BUTTONS */
.button-container .icon-button {
    background: linear-gradient(145deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #212529;
    border-radius: 14px ;
    border: 1px solid #cfd8de ;
    padding: 10px 16px ;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.profile-modal .btn{
    background: linear-gradient(145deg, #f0f0f0 0%, #e0e0e0 100%) !important;
    color: #212529 !important;
    border-radius: 14px !important;
    border: 1px solid #cfd8de !important;
    padding: 10px 16px !important;
    font-weight: 600 !important;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease !important;
}

.profile-modal .btn:hover{
    background: linear-gradient(145deg, #e0e0e0, #d0d0d0)!important;
    transform: translateY(-3px)!important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12)!important;
}


.button-container .icon-button:hover {
    background: linear-gradient(145deg, #e0e0e0, #d0d0d0);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    background: #ff4d4f;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* ==================== MOBILE MENU ANIMATION ==================== */
.navbar-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}

.navbar-collapse.show {
    max-height: 500px;
}

.navbar-nav .nav-item {
    opacity: 0;
    transform: translateY(-10px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.navbar-collapse.show .navbar-nav .nav-item {
    opacity: 1;
    transform: translateY(0);
}

.navbar-collapse.show .navbar-nav .nav-item:nth-child(1) { transition-delay: 0.05s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(2) { transition-delay: 0.1s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(3) { transition-delay: 0.15s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(4) { transition-delay: 0.2s; }

/* ==================== DESKTOP FIX ==================== */

@media (min-width: 340px){
#searchModalInput, .search-modal-content button{
     padding: 5px 7px;
     
}
.search-modal-content{
    display: flex;
    justify-content: center;
}
}

@media (min-width: 768px) {
    .navbar-collapse {
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
    }
    .navbar-nav {
        flex-direction: row;
        gap: 15px;
    }
    .navbar-nav .nav-item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}


