/* public/css/mobile.css - Styles version Mobile */
/* Ce fichier ne s'active que pour les petits écrans (max-width: 768px) */

@media (max-width: 768px) {

    /* ---- HEADER ---- */
    .header-inner {
        padding: 0 16px;
        height: 58px;
        position: relative;
    }

    .logo { font-size: 1.5rem; }

    /* ---- NAVIGATION MOBILE ---- */
    /* Overlay derrière le nav pour bloquer les clics et fermer au tap */
    #nav-overlay {
        display: none;
        position: fixed;
        top: 58px; left: 0;
        width: 100%; height: calc(100vh - 58px);
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }
    #nav-overlay.open { display: block; }

    #nav {
        position: fixed;
        top: 58px; left: 0;
        width: 75%;
        max-width: 300px;
        height: calc(100vh - 58px);
        background: var(--noir-2);
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 20px 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        border-right: 3px solid var(--rouge);
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    #nav.open {
        transform: translateX(0);
    }
    .nav-link {
        width: 100%;
        padding: 16px 24px;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--noir-4);
        font-size: 1rem;
    }
    .nav-link:hover {
        background: rgba(229, 25, 42, 0.1);
        border-color: transparent;
    }

    /* ---- ACCOUNT BADGE MOBILE ---- */
    /* Le dropdown desktop est caché sur mobile */
    .account-dropdown { display: none !important; }

    /* Le badge devient juste décoratif sur mobile (le burger ouvre le nav) */
    .user-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
        pointer-events: none; /* non cliquable sur mobile, le burger gère */
        border-radius: 4px;
    }
    .badge-arrow { display: none; }

    /* ---- BURGER BUTTON (toujours visible sur mobile) ---- */
    .burger-btn {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        background: none;
        border: none;
        z-index: 1001;
    }
    .burger-btn span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--blanc);
        transition: var(--transition);
        border-radius: 2px;
    }
    .burger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .burger-btn.open span:nth-child(2) { opacity: 0; }
    .burger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* ---- USER ZONE MOBILE ---- */
    .user-zone {
        flex-direction: column;
        gap: 8px;
    }
    .user-badge {
        padding: 4px 10px;
    }
    .user-points { font-size: 0.9rem; }

    /* ---- HEADER ACTIONS MOBILE ---- */
    .header-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* ---- MAIN ---- */
    #main {
        padding: 20px 16px;
    }

    /* ---- HERO ---- */
    .hero {
        padding: 28px 20px;
        margin-bottom: 30px;
    }
    .hero-title { font-size: 2.2rem; }

    /* Boutons hero en colonne sur mobile */
    .hero .hero-btns {
        flex-direction: column;
        gap: 10px;
    }
    .hero .hero-btns .btn,
    .hero .hero-btns .btn-partenaire,
    .hero .hero-btns a {
        width: 100%;
        text-align: center;
        justify-content: center;
        box-sizing: border-box;
    }

    /* ---- SECTION HEADER ---- */
    .section-title { font-size: 1.4rem; }

    /* ---- NEWS GRID : défilement horizontal sur mobile ---- */
    .news-grid {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
        gap: 14px;
        padding-bottom: 12px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .news-grid::-webkit-scrollbar { display: none; } /* Chrome/Safari */

    .news-grid .news-card {
        flex: 0 0 78vw;
        max-width: 300px;
        min-width: 220px;
        scroll-snap-align: start;
    }

    /* Sur la page d'accueil : limiter à 3 cartes max visibles */
    .news-grid-home .news-card:nth-child(n+4) {
        display: none;
    }
    /* Réactiver le 3ème (était caché avant) */
    .news-grid-home .news-card:nth-child(3) {
        display: flex;
    }

    /* ---- MODAL DESCRIPTION : mise en forme ---- */
    .desc-toggle {
        display: inline-block;
        margin-top: 4px;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--rouge);
        text-decoration: underline;
        text-decoration-style: dotted;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        font-family: var(--font-ui);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* ---- ARTICLE ---- */
    .article-title { font-size: 1.8rem; }
    .article-meta { flex-direction: column; gap: 6px; }

    /* ---- WALLET ---- */
    .wallet-hero { padding: 24px 20px; }
    .wallet-balance { font-size: 3.5rem; }

    .transactions-table, .transactions-table thead, .transactions-table tbody,
    .transactions-table th, .transactions-table td, .transactions-table tr {
        display: block;
    }
    .transactions-table thead tr { display: none; }
    .transactions-table tr {
        background: var(--noir-2);
        margin-bottom: 12px;
        border-radius: var(--radius);
        border: 1px solid var(--noir-4);
        overflow: hidden;
    }
    .transactions-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--noir-3);
        padding: 10px 14px;
    }
    .transactions-table td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--gris);
        font-weight: 700;
        margin-right: 10px;
    }

    /* ---- FORMS ---- */
    .form-card { padding: 24px 20px; }
    .form-title { font-size: 1.6rem; }

    /* ---- STATS ---- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-value { font-size: 1.8rem; }

    /* ---- ADMIN TABLE ---- */
    .admin-table, .admin-table thead, .admin-table tbody,
    .admin-table th, .admin-table td, .admin-table tr {
        display: block;
    }
    .admin-table thead tr { display: none; }
    .admin-table tr {
        margin-bottom: 12px;
        border-radius: var(--radius);
        border: 1px solid var(--noir-4);
    }
    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--noir-3);
        padding: 10px 14px;
    }
    .admin-table td::before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--gris);
        font-weight: 700;
    }

    /* ---- PAGINATION ---- */
    .pagination { flex-wrap: wrap; }
    .page-btn { padding: 8px 12px; font-size: 0.8rem; }

    /* ---- TABS ---- */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab-btn { white-space: nowrap; padding: 12px 16px; }

    /* ---- BUTTONS ---- */
    .btn { justify-content: center; }


    /* ---- HIDE ON MOBILE ---- */
    .hide-mobile { display: none !important; }

    /* ---- SHOW ON MOBILE ---- */
    .show-mobile { display: block !important; }

    /* ---- PAGE WRAP ---- */
    .page-wrap { max-width: 100%; }

    /* ---- TEXTAREA ---- */
    textarea.form-input { min-height: 150px; }

    /* ---- FOOTER ---- */
    #footer { padding: 20px 16px; }
}

/* ---- Par défaut, masquer le burger sur desktop ---- */
.burger-btn { display: none; }
