/* ==============================
   FAMILLE - SMARTPHONES PAYSAGE
   Version responsive optimisée
============================== */
@media screen and (max-width: 1024px) and (orientation: landscape) {

    body {
        padding: 0 15px;
        overflow-x: hidden;
    }

    /* ==============================
       BARRE DE NAVIGATION HAUTE
       (Bouton retour à gauche + User à droite)
    ============================== */
    .top-nav-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 10px 0;
        margin-bottom: 5px;
        z-index: 9999;
        position: relative;
        order: -1;
        max-width: 100%;
    }

    /* Bouton retour à gauche */
    #backBtn {
        position: relative;
        top: auto;
        left: auto;
        padding: 10px 20px;
        font-size: 0.85rem;
        background: rgba(0, 234, 255, 0.15);
        color: #00eaff;
        border: 1.5px solid #00eaff;
        border-radius: 8px;
        box-shadow: 0 0 15px rgba(0, 234, 255, 0.3);
        margin: 0;
        flex-shrink: 0;
    }

    /* Bouton utilisateur à droite */
    #userBtn {
        padding: 10px 20px;
        font-size: 0.85rem;
        border-radius: 8px;
        min-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        background: rgba(0, 234, 255, 0.12);
        border: 1.5px solid #00eaff;
        color: #00eaff;
        box-shadow: 0 0 10px rgba(0, 234, 255, 0.2);
        margin: 0;
        flex-shrink: 0;
    }

    /* MENU DÉROULANT UTILISATEUR */
    #userInfo {
        position: absolute;
        top: 100%;
        right: 0;
        width: 200px;
        margin-top: 8px;
        padding: 12px;
        background: rgba(22, 26, 34, 0.98);
        border: 1.5px solid #00eaff;
        border-radius: 10px;
        box-shadow: 0 8px 25px rgba(0, 234, 255, 0.4);
        z-index: 10000;
        display: none;
    }

    #userInfo.show { display: block; }

    #userInfo::before {
        content: '';
        position: absolute;
        top: -10px;
        right: 20px;
        border: 10px solid transparent;
        border-bottom-color: #00eaff;
    }

    /* LOGO */
    .logo-img { 
        width: 150px;
        margin-top: 15px;
        margin-bottom: 10px;
    }

    /* MENU CARTES EN PAYSAGE */
    .menu {
        margin: 20px 0 60px;
        gap: 40px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .card {
        width: 280px;
        min-height: 250px;
    }

    .card img { 
        height: 180px; 
    }
    
    .card span {
        padding: 14px;
        font-size: 1.05rem;
    }
    
    /* Supprime l'ancien user-panel */
    .user-panel {
        display: none;
    }
    
    /* Téléphones en paysage avec peu de hauteur */
    @media screen and (max-height: 500px) {
        .menu {
            margin: 15px 0 50px;
            gap: 30px;
        }
        .card {
            width: 240px;
            min-height: 220px;
        }
        .card img { 
            height: 150px; 
        }
        .logo-img { 
            width: 130px;
            margin-top: 12px;
        }
        #backBtn, #userBtn {
            padding: 8px 16px;
            font-size: 0.8rem;
        }
        .top-nav-bar {
            padding: 8px 0;
        }
    }
    
    /* Pour les paysages très larges mais courts */
    @media screen and (max-width: 1024px) and (orientation: landscape) and (max-height: 400px) {
        .menu {
            gap: 20px;
        }
        .card {
            width: 220px;
            min-height: 200px;
        }
        .card img { 
            height: 130px; 
        }
        .card span {
            padding: 10px;
            font-size: 0.95rem;
        }
        #backBtn, #userBtn {
            padding: 7px 14px;
            font-size: 0.75rem;
        }
    }
}