/**
 * Alter Menu Fixe - Styles
 * @author Frédéric CARRE - Alterneo.net
 * @version 1.1.0
 */

.amf-fixed-menu {
    position: fixed;
    z-index: var(--amf-z-index, 9999);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: amfFadeIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.amf-menu-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    gap: 8px;
    transition: all 0.3s ease;
}

.amf-menu-item {
    border-radius: 5px;
    transition: all 0.3s ease;
}

.amf-menu-item a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    padding: 8px !important;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.amf-menu-item:hover {
    filter: brightness(1.2);
}

.amf-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--amf-icon-size, 24px);
    height: var(--amf-icon-size, 24px);
}

/* ==================== BOUTON TIROIR ==================== */
.amf-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 4px;
    margin: 0 auto 4px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amf-drawer-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.amf-drawer-toggle:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.amf-drawer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* État fermé */
.amf-drawer-closed .amf-menu-list {
    display: none;
}

.amf-drawer-closed .amf-drawer-toggle {
    margin-bottom: 0;
}

/* ==================== TIROIR DE TITRE ==================== */
.amf-title-drawer {
    position: absolute;
    padding: 8px 12px;
    white-space: nowrap;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10001;
    font-weight: 500;
}

.amf-menu-item:hover .amf-title-drawer {
    opacity: 1;
    visibility: visible;
}

/* ==================== POSITIONS ==================== */

/* Position Droite */
.amf-position-right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.amf-position-right .amf-menu-list {
    flex-direction: column;
}

.amf-position-right .amf-title-drawer {
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
}

.amf-position-right .amf-title-drawer::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}

/* Position Gauche */
.amf-position-left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.amf-position-left .amf-menu-list {
    flex-direction: column;
}

.amf-position-left .amf-title-drawer {
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
}

.amf-position-left .amf-title-drawer::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
}

/* Position Haut */
.amf-position-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.amf-position-top .amf-menu-list {
    flex-direction: row;
}

.amf-position-top .amf-title-drawer {
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
}

/* Position Bas */
.amf-position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.amf-position-bottom .amf-menu-list {
    flex-direction: row;
}

.amf-position-bottom .amf-title-drawer {
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
}

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 768px) {
    /* Taille d'icônes réduite sur mobile */
    .amf-fixed-menu .amf-icon {
        width: var(--amf-icon-size-mobile, 20px) !important;
        height: var(--amf-icon-size-mobile, 20px) !important;
    }

    .amf-fixed-menu .amf-menu-item a {
        padding: 6px !important;
    }

    /* Positions desktop */
    .amf-position-right {
        right: 10px;
    }

    .amf-position-left {
        left: 10px;
    }

    .amf-position-top {
        top: 10px;
    }

    .amf-position-bottom {
        bottom: 10px;
    }

    /* Cacher les tiroirs de titre sur mobile */
    .amf-title-drawer {
        display: none !important;
    }
}

/* Positions spécifiques mobiles */
@media (max-width: 768px) {
    .amf-mobile-position-bottom {
        bottom: 10px !important;
        left: 50% !important;
        top: auto !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .amf-mobile-position-bottom .amf-menu-list {
        flex-direction: row !important;
    }

    .amf-mobile-position-top {
        top: 10px !important;
        left: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .amf-mobile-position-top .amf-menu-list {
        flex-direction: row !important;
    }

    .amf-mobile-position-right {
        right: 10px !important;
        top: 50% !important;
        left: auto !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }

    .amf-mobile-position-right .amf-menu-list {
        flex-direction: column !important;
    }

    .amf-mobile-position-left {
        left: 10px !important;
        top: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }

    .amf-mobile-position-left .amf-menu-list {
        flex-direction: column !important;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes amfFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ==================== ACCESSIBILITÉ ==================== */
@media (prefers-reduced-motion: reduce) {
    .amf-fixed-menu,
    .amf-menu-item,
    .amf-title-drawer,
    .amf-drawer-toggle {
        animation: none !important;
        transition: none !important;
    }
}

/* ==================== IMPRESSION ==================== */
@media print {
    .amf-fixed-menu { display: none !important; }
}
