/* Navigation Mobile Unifiée */
:root {
    /* Hiérarchie des couleurs */
    --nav-site-color: #007bff;        /* Couleur principale du site (bleu) */
    --nav-donateur-color: #dfb729;    /* Couleur espace donateur (jaune) */
    --nav-success-color: #28a745;     /* Actions positives (vert) */
    --nav-danger-color: #dc3545;      /* Actions de suppression (rouge) */
    --nav-dark-color: #343a40;        /* Texte foncé */
    --nav-light-color: #f8f9fa;       /* Arrière-plans clairs */
    --nav-border-radius: 12px;
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --nav-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Styles pour l'icône de login dans le header */
.mobile-login-icon {
    margin-right: 15px;
}

/* Centrage du bouton desktop sur tablette paysage et desktop */
@media (min-width: 1024px), (min-width: 768px) and (orientation: landscape) {
    .button.button--squared {
        display: flex !important;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}

.mobile-login-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--nav-transition);
    font-size: 20px;
}

.mobile-login-link--guest {
    background: var(--nav-site-color);
    color: white;
}

.mobile-login-link--logged {
    background: var(--nav-donateur-color);
    color: white;
}

.mobile-login-link:hover {
    transform: scale(1.1);
    text-decoration: none;
    color: white;
}

/* Navigation mobile unifiée */
.unified-mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999999;
}

/* Bouton flottant unifié - forcé au premier plan */
.unified-mobile-nav__fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--nav-site-color) !important;
    border: none;
    color: white !important;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--nav-shadow);
    transition: var(--nav-transition);
    pointer-events: auto;
    z-index: 999998 !important;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Afficher sur mobile et tablette portrait */
@media (max-width: 1023px) and (orientation: portrait), (max-width: 767px) {
    .unified-mobile-nav__fab {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Masquer sur tablette paysage et desktop */
@media (min-width: 1024px), (min-width: 768px) and (orientation: landscape) {
    .unified-mobile-nav__fab {
        display: none !important;
    }
}

.unified-mobile-nav__fab:hover {
    transform: scale(1.1);
    background: #0056b3;
}

.unified-mobile-nav__fab.active {
    transform: rotate(45deg);
    background: var(--nav-danger-color);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Overlay */
.unified-mobile-nav__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--nav-transition);
    pointer-events: none;
}

.unified-mobile-nav__overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Menu - style moderne du bas */
.unified-mobile-nav__menu {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    background: white;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999997 !important;
}

.unified-mobile-nav__menu.active {
    bottom: 0;
}

/* Header du menu simplifié */
.unified-mobile-nav__header {
    padding: 20px 20px 15px 20px;
    background: var(--nav-site-color);
    color: white;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

/* Poignée de drag pour indiquer qu'on peut fermer */
.unified-mobile-nav__header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.unified-mobile-nav__user,
.unified-mobile-nav__guest {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unified-mobile-nav__user i,
.unified-mobile-nav__guest i {
    font-size: 20px;
}

.unified-mobile-nav__user span,
.unified-mobile-nav__guest span {
    font-size: 14px;
    font-weight: 500;
}

/* Items du menu - design en cards 2 colonnes */
.unified-mobile-nav__items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(70vh - 80px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.unified-mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 13px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    text-align: center;
    gap: 8px;
}

.unified-mobile-nav__item:hover {
    background: #e9ecef;
    color: #333;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.unified-mobile-nav__item i {
    font-size: 24px;
    color: #333;
    margin-bottom: 4px;
}

.unified-mobile-nav__item span {
    font-weight: 600;
    line-height: 1.2;
    font-size: 12px;
    color: #333;
}

/* Item principal (Espace donateur) */
.unified-mobile-nav__item--primary {
    background: rgba(223, 183, 41, 0.1);
    color: var(--nav-donateur-color);
    border: 2px solid rgba(223, 183, 41, 0.2);
}

.unified-mobile-nav__item--primary i {
    color: var(--nav-donateur-color);
    font-size: 26px;
}

.unified-mobile-nav__item--primary:hover {
    background: rgba(223, 183, 41, 0.15);
    color: var(--nav-donateur-color);
    border-color: var(--nav-donateur-color);
}

/* Item PWA */
.unified-mobile-nav__item--pwa {
    color: var(--nav-success-color);
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid rgba(40, 167, 69, 0.2);
    cursor: pointer;
    grid-column: 1 / -1; /* Prend toute la largeur */
    flex-direction: row;
    justify-content: center;
    min-height: auto;
    padding: 12px 15px;
}

.unified-mobile-nav__item--pwa i {
    color: var(--nav-success-color);
    font-size: 18px;
    margin-bottom: 0;
    margin-right: 8px;
}

.unified-mobile-nav__item--pwa span {
    font-size: 13px;
    font-weight: 600;
}

.unified-mobile-nav__item--pwa:hover {
    background: rgba(40, 167, 69, 0.15);
    color: var(--nav-success-color);
    border-color: var(--nav-success-color);
}

/* Item de déconnexion */
.unified-mobile-nav__item--logout {
    color: var(--nav-danger-color);
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid rgba(220, 53, 69, 0.2);
    grid-column: 1 / -1; /* Prend toute la largeur */
    flex-direction: row;
    justify-content: center;
    min-height: auto;
    padding: 12px 15px;
    margin-top: 10px;
}

.unified-mobile-nav__item--logout i {
    color: var(--nav-danger-color);
    font-size: 18px;
    margin-bottom: 0;
    margin-right: 8px;
}

.unified-mobile-nav__item--logout span {
    font-size: 13px;
    font-weight: 600;
}

.unified-mobile-nav__item--logout:hover {
    background: rgba(220, 53, 69, 0.15);
    color: var(--nav-danger-color);
    border-color: var(--nav-danger-color);
}

/* Masquer le header complet sur mobile et tablette portrait pour les utilisateurs connectés */
@media (max-width: 1023px) and (orientation: portrait), (max-width: 767px) {
    .header-container--logged {
        display: none !important;
    }
}

/* Masquer l'ancien menu hamburger du header sur mobile et tablette portrait */
@media (max-width: 1023px) and (orientation: portrait), (max-width: 767px) {
    .dropdown-trigger {
        display: none !important;
    }
    
    .aside-dropdown {
        display: none !important;
    }
}

/* Réactiver l'ancien menu sur tablette paysage et desktop */
@media (min-width: 1024px), (min-width: 768px) and (orientation: landscape) {
    .dropdown-trigger {
        display: block !important;
    }
    
    .aside-dropdown {
        display: block !important;
    }
}

/* Le bouton FAB doit apparaître partout, y compris dans l'espace donateur */

/* Affichage conditionnel du bouton FAB */
.unified-mobile-nav__fab {
    display: none;
}

/* Animation d'entrée du bas */
@keyframes slideInUp {
    from {
        bottom: -100%;
    }
    to {
        bottom: 0;
    }
}

.unified-mobile-nav__menu.active {
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation du bouton */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.unified-mobile-nav__fab:active {
    animation: bounce 0.6s;
}

/* Responsive pour très petits écrans */
@media (max-width: 480px) {
    
    .unified-mobile-nav__items {
        padding: 15px;
        gap: 10px;
    }
    
    .unified-mobile-nav__item {
        padding: 12px 8px;
    }
    
    .unified-mobile-nav__item i {
        font-size: 22px;
    }
    
    .unified-mobile-nav__item span {
        font-size: 11px;
    }
    
    .unified-mobile-nav__item--primary i {
        font-size: 24px;
    }
    
    .unified-mobile-nav__fab {
        bottom: 18px;
        right: 18px;
        width: 55px;
        height: 55px;
    }
}
