/* ResiPlan - Styles améliorés pour la navigation
   Version: 1.0.0
*/

/* Mise en évidence améliorée du menu actif */
.navbar-nav .nav-link {
    position: relative;
    transition: var(--transition-fast);
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: var(--border-radius-sm);
    margin: 0 0.15rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: var(--light);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Styles pour les dropdown menus */
.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-md);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
}

.dropdown-menu:before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background-color: white;
    transform: rotate(45deg);
    border-radius: 2px;
    z-index: -1;
}

.dropdown-item {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--gray-100);
    transform: translateX(3px);
}

.dropdown-item.active {
    background-color: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-weight: 500;
    position: relative;
}

.dropdown-item.active:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary);
    border-radius: 0 3px 3px 0;
}

/* Menu récemment visité */
.recent-pages {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-sm);
    margin-top: 0.5rem;
}

.recent-pages.show {
    max-height: 200px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.recent-pages-title {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.recent-pages-title:before,
.recent-pages-title:after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: var(--gray-300);
    margin: 0 0.5rem;
}

.recent-page-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

.recent-page-item i {
    margin-right: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Menu contextuel pour la section active */
.contextual-menu {
    background-color: var(--primary-light);
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-top: -5px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contextual-menu-item {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: var(--border-radius-sm);
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contextual-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contextual-menu-item i {
    margin-right: 0.3rem;
}

/* Styles pour petits écrans */
@media (max-width: 992px) {
    .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .contextual-menu {
        flex-direction: column;
        align-items: stretch;
    }
    
    .contextual-menu-item {
        text-align: left;
    }
}

/* Mode compact pour écrans moyens */
@media (min-width: 992px) and (max-width: 1200px) {
    .compact-mode .nav-link-text {
        display: none;
    }
    
    .compact-mode .nav-link i {
        font-size: 1.2rem;
        margin-right: 0 !important;
    }
    
    .compact-mode .navbar-nav .nav-link {
        padding: 0.5rem;
        display: flex;
        justify-content: center;
    }
    
    .compact-mode .navbar-nav .nav-item {
        display: flex;
        justify-content: center;
    }
}

/* Animation de badge pour nouveauté */
.badge-new {
    position: relative;
    overflow: hidden;
}

.badge-new::after {
    content: 'Nouveau';
    position: absolute;
    top: 0.25rem;
    right: -1.5rem;
    background-color: var(--danger);
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 1.5rem;
    transform: rotate(45deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Animation de l'icône du menu hamburger */
.navbar-toggler {
    transition: transform 0.3s;
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler[aria-expanded="true"] {
    transform: rotate(90deg);
}

.navbar-toggler-icon {
    transition: var(--transition);
}
