/* =========================================================
   MISE EN PAGE : structure générale, en-tête, navigation
   ========================================================= */

/* Conteneur principal de l'application */
#app {
    display: flex;
    flex-direction: column;
    /* dvh = dynamic viewport height : tient compte de la barre du navigateur mobile */
    height: 100vh;
    height: 100dvh;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    /* La nav .bottom-nav est en dehors de #app dans le DOM,
       donc overflow:hidden ne la bloque plus sur iPhone Safari */
}

/* Corps scrollable de la page (entre en-tête et nav) */
.screen-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Espace sous le contenu pour ne pas passer sous la nav fixe */
    padding-bottom: calc(80px + var(--safe-bottom));
}

/* ---------- En-tête (barre du haut) ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--primary);
    color: #FFF;
    box-shadow: var(--shadow);
    z-index: 10;
}

.app-header-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ---------- Page de connexion ---------- */
.screen-login {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 24px;
    background: linear-gradient(160deg, #FAF5EF 0%, #F2EAD9 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.login-hint {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ---------- Barre de filtres (chips horizontaux) ---------- */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    transition: all 0.15s;
}
.filter-chip.active {
    background: var(--primary);
    color: #FFF;
    border-color: var(--primary);
}

/* ---------- Navigation du bas ---------- */
.bottom-nav {
    /* fixed : toujours visible quelle que soit la hauteur du viewport mobile */
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    display: flex;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -4px 14px rgba(0,0,0,0.05);
    z-index: 20;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    min-height: 64px;
    transition: color 0.2s;
    position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 26px; height: 26px; }

/* Bouton flottant central (FAB) */
.nav-fab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(217, 119, 87, 0.4);
    margin-top: -16px;
    transition: transform 0.15s;
}
.nav-fab-btn:active { transform: scale(0.94); }
.nav-fab-btn svg { width: 30px; height: 30px; }

/* État vide (lorsqu'il n'y a aucune publication / notif) */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state-emoji {
    font-size: 64px;
    margin-bottom: 12px;
}
.empty-state-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.empty-state-text {
    font-size: 16px;
}

/* Titre de section (utilisé sur profil, publication détail) */
.section-title,
.profile-section {
    padding: 18px 16px 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
