/* Bottom Navigation Bar Mobile */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Masquer sur desktop pour éviter les conflits avec la sidebar */
@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

.bottom-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0.5rem 0;
    height: 60px;
    background: white;
}

.bottom-nav-bar .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.7rem;
    flex: 1;
    padding: 0.25rem;
    transition: all 0.2s ease;
    min-height: 50px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.bottom-nav-bar .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-bar .nav-item.active {
    color: #00AE9E;
}

.bottom-nav-bar .nav-item:active {
    transform: scale(0.95);
    opacity: 0.7;
}

/* Bouton central (créer) */
.nav-item-center {
    position: relative;
    flex: 0 0 auto;
    margin: 0 0.5rem;
}

.nav-center-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00AE9E 0%, #33C2B5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 174, 158, 0.4);
    transition: all 0.3s ease;
    margin-top: -20px;
}

.nav-center-button i {
    font-size: 1.5rem;
    margin: 0;
}

.nav-item-center:active .nav-center-button {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(0, 174, 158, 0.3);
}

/* Menu mobile slide-in */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1051;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85%;
    height: 100vh;
    background: white;
    z-index: 1052;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.mobile-menu.show {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #00AE9E 0%, #33C2B5 100%);
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.mobile-menu-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 1;
}

.mobile-menu-body {
    padding: 1rem 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #343a40;
    text-decoration: none;
    transition: background 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: #f8f9fa;
    color: #00AE9E;
}

.mobile-menu-item i {
    width: 24px;
    text-align: center;
    color: #6c757d;
}

.mobile-menu-item:hover i,
.mobile-menu-item:active i {
    color: #00AE9E;
}

/* Ajuster le padding bottom du contenu pour éviter que le bottom nav masque le contenu */
@media (max-width: 767px) {
    body {
        padding-bottom: 60px !important;
    }
    
    .container-fluid.p-0 {
        padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    }
    
    .main-content {
        padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    }
    
    /* Safe area pour iPhone avec encoche */
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .fixed-bottom {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    }
    
    /* Masquer la sidebar et son toggle sur mobile */
    .sidebar {
        display: none !important;
    }
    
    #sidebarToggle {
        display: none !important;
    }
    
    /* Le contenu principal prend toute la largeur sur mobile */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Sur desktop, s'assurer que le système mobile n'interfère pas */
@media (min-width: 768px) {
    body {
        padding-bottom: 0 !important;
    }
    
    .main-content {
        padding-bottom: 0 !important;
    }
}

/* Animation d'entrée */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.mobile-bottom-nav {
    animation: slideInFromBottom 0.3s ease;
}
