/* =========================================================================
   MAPIRANDO EVENTS — CSS COMPLET v7.0 (MERGE PROPRE)
   ========================================================================= */

/* MASQUAGE HEADER POUR PLEIN ECRAN (Formulaire et Fiche Sortie) */
.page-header, .entry-header { display: none !important; }
header.site-header, #masthead, .ct-header { background: transparent !important; box-shadow: none !important; position: absolute !important; width: 100%; top: 0; z-index: 100; }

/* ==========================================================================
   B. HERO HEADER (Fiche Sortie et Formulaire)
   ========================================================================== */
.mapi-hero-full {
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    max-width: 100vw !important;
    height: 550px;
    box-sizing: border-box !important;
    margin-top: 0;
    padding-top: 170px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    overflow: hidden;
}
.mapi-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.8)); z-index: 1; }
.mapi-comm-title { font-size: 2em; font-weight: 800; color: white; margin: 5px 0 15px 0; text-transform: uppercase; font-family: sans-serif; text-shadow: 0 4px 15px rgba(0,0,0,0.5); text-align: center; position: relative; z-index: 2; line-height: 1.2; }
.mapi-comm-subtitle { font-size: 1.2em; margin-bottom: 30px; font-weight: 300; font-family: sans-serif; color: white !important; text-shadow: 0 2px 5px rgba(0,0,0,0.5); text-align: center; position: relative; z-index: 2; }
.mapi-hero-txt { position: relative; z-index: 2; text-align: center; color: white; width: 90%; max-width: 800px; }

/* ==========================================================================
   C. FORMULAIRE CREATION (form-create-event.php)
   ========================================================================== */
.mapi-form-container {
    max-width: 800px !important;
    margin: -80px auto 60px auto !important;
    position: relative;
    z-index: 10;
    background: white !important;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    box-sizing: border-box !important;
    width: 100% !important;
}
.mapi-label { font-weight: 600; display: block; margin-bottom: 5px; color: #333; font-family: sans-serif; }
.mapi-input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; background: #fdfdfd; font-family: sans-serif; box-sizing: border-box; transition: all 0.2s; color: #333; }
.mapi-input:focus { border-color: #1D1D1F; background: white; outline: none; box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.08); }
select.mapi-input { min-height: 46px; height: auto !important; padding-top: 12px !important; padding-bottom: 12px !important; line-height: normal !important; }
.mapi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.mapi-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.mapi-btn-group-apple { display: flex; gap: 12px; margin-top: 40px; justify-content: center; }

/* Radios dynamiques avec couleurs */
.mapi-radio-box { display: block; text-align: center; padding: 10px; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; background: white; transition: all 0.2s; font-family: sans-serif; }
input[type="radio"][value="tranquille"]:checked + .mapi-radio-box { background: #ecfdf5; border-color: #10b981; color: #047857; font-weight: bold; }
input[type="radio"][value="modere"]:checked + .mapi-radio-box { background: #fffbeb; border-color: #f59e0b; color: #b45309; font-weight: bold; }
input[type="radio"][value="sportif"]:checked + .mapi-radio-box { background: #fdf2f8; border-color: #f43f5e; color: #be123c; font-weight: bold; }
input[type="radio"][value="oui"]:checked + .mapi-radio-box { background: #ecfdf5; border-color: #10b981; color: #047857; font-weight: bold; }
input[type="radio"][value="non"]:checked + .mapi-radio-box { background: #f8fafc; border-color: #94a3b8; color: #334155; font-weight: bold; }

/* Pilules Equipement */
.mapi-equip-label { cursor: pointer; display: inline-block; }
.mapi-equip-pill { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid #e2e8f0; border-radius: 50px; background: #f8fafc; color: #64748b; font-size: 0.9em; font-weight: 600; transition: all 0.2s; user-select: none; }
.mapi-equip-pill svg { width: 18px; height: 18px; opacity: 0.6; transition: 0.2s; }
.mapi-equip-label:hover .mapi-equip-pill { background: #f1f5f9; }
.mapi-equip-label input:checked + .mapi-equip-pill { border-color: var(--eq-color); color: var(--eq-color); background: white; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.mapi-equip-label input:checked + .mapi-equip-pill svg { opacity: 1; color: var(--eq-color); }

/* ==========================================================================
   D. FICHE SORTIE (single-community-event.php)
   ========================================================================== */
.mapirando-community-wrapper {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}
.mapi-tiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: -80px; position: relative; z-index: 10; margin-bottom: 30px; }
.mapirando-stat-card { background: white; padding: 15px 10px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); text-align: center; transition: transform 0.2s; }
.mapirando-stat-card:hover { transform: translateY(-3px); }
.p3-frais { display: flex; align-items: center; gap: 15px; }
.p3-icon-circle { width: 50px; height: 50px; background: #f1f5f9; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.p3-equip-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.p3-equip-item { display: flex; align-items: center; gap: 12px; font-size: 0.95em; color: #334155; font-weight: 600; background: white; padding: 12px 15px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: transform 0.2s; }
.p3-equip-item:hover { transform: translateY(-2px); }
.p3-timeline { position: relative; padding-left: 30px; }
.p3-timeline::before { content: ''; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 2px; background: #e2e8f0; }
.p3-time-node { position: relative; margin-bottom: 35px; }
.p3-time-node::before { content: ''; position: absolute; left: -27px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid; z-index: 2; }
.mapi-layout-3col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); gap: 30px; margin-bottom: 50px; align-items: start; }

/* ==========================================================================
   E. DISCUSSION / CHAT (class-event-discussion.php)
   ========================================================================== */
.mapi-chat-wrapper { max-width: 800px; margin: 40px auto; font-family: sans-serif; background: #fff; padding: 30px; border-radius: 12px; border: 1px solid #eee; box-shadow: 0 5px 20px rgba(0,0,0,0.02); }
.mapi-chat-title { font-size: 1.3em; color: #2c3e50; border-bottom: 2px solid #f0f0f0; padding-bottom: 15px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.mapi-chat-list { margin-bottom: 30px; }
.mapi-chat-msg { display: flex; gap: 15px; margin-bottom: 20px; animation: fadeIn 0.5s; }
.mapi-chat-replies { margin-left: 50px; border-left: 2px solid #f0f0f0; padding-left: 15px; margin-bottom: 20px; }
.mapi-msg-avatar img { border-radius: 50%; width: 40px; height: 40px; object-fit: cover; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.mapi-msg-content { background: #f8f9fa; padding: 12px 18px; border-radius: 0 12px 12px 12px; position: relative; flex-grow: 1; }
.mapi-msg-meta { font-size: 0.85em; color: #7f8c8d; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.mapi-msg-author { color: #2c3e50; font-weight: bold; text-decoration: none; }
.mapi-msg-author:hover { text-decoration: underline; }
.mapi-msg-text { font-size: 0.95em; color: #333; line-height: 1.5; }
.mapi-msg-actions { margin-top: 8px; font-size: 0.8em; display: flex; gap: 15px; }
.mapi-btn-reply { color: #27ae60; cursor: pointer; font-weight: 600; background: none; border: none; padding: 0; transition: color 0.2s; }
.mapi-btn-reply:hover { color: #219150; text-decoration: underline; }
.mapi-btn-del { color: #e74c3c; text-decoration: none; opacity: 0.6; transition: opacity 0.2s; }
.mapi-btn-del:hover { opacity: 1; }
.mapi-chat-input { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 12px; font-family: inherit; font-size: 0.95em; transition: 0.3s; resize: vertical; box-sizing: border-box; }
.mapi-chat-input:focus { border-color: #27ae60; outline: none; background: #fff; }
.mapi-chat-send { margin-top: 10px; background: #2c3e50; color: white; border: none; padding: 8px 20px; border-radius: 50px; font-weight: bold; cursor: pointer; float: right; display: flex; align-items: center; gap: 5px; transition: 0.3s; }
.mapi-chat-send:hover { background: #34495e; transform: translateX(3px); }
.mapi-no-msg { text-align: center; color: #95a5a6; font-style: italic; padding: 20px; }
.mapi-chat-login { text-align: center; background: #f9f9f9; padding: 15px; border-radius: 8px; font-size: 0.9em; }
.mapi-user-avatar-mini { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
.mapi-user-avatar-mini img { width: 100%; height: 100%; object-fit: cover; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Actions Slim (cercles gris — identique au topo) */
.mapi-slim-action {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: #f1f5f9;
    border: none; cursor: pointer; text-decoration: none;
    transition: all 0.2s ease; border-radius: 50%;
    padding: 0; flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.mapi-slim-action.mapi-slim-lg { width: 54px; height: 54px; }
.mapi-slim-action:hover { background: #e2e8f0; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.06); }
.mapi-slim-action:active { transform: scale(0.92); }
.mapi-slim-icon {
    font-size: 20px; color: #475569;
    font-variation-settings: 'FILL' 0, 'wght' 400;
    transition: all 0.2s;
}
.mapi-slim-icon-lg { font-size: 24px; }
.mapi-slim-action:hover .mapi-slim-icon { color: #1e293b; }
.mapi-slim-active { color: #e11d48 !important; font-variation-settings: 'FILL' 1, 'wght' 400 !important; }

/* Modales Airy (identique au topo) */
.airy-modal-overlay { display: flex; align-items: center; justify-content: center; }
.airy-modal {
    background-color: #ffffff; border-radius: 24px; padding: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.08); box-sizing: border-box;
    display: flex; flex-direction: column; position: relative; z-index: 10;
    max-height: 90vh; overflow-y: auto;
}
.airy-share-modal { width: 260px; max-width: 90vw; }
.airy-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.airy-modal-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.4px; color: #000000; }
.airy-share-modal .airy-close-btn { position: absolute; top: 20px; right: 20px; }
.airy-close-btn { background: transparent; border: none; cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center; color: #cccccc; transition: color 0.2s; }
.airy-close-btn:hover { color: #888888; }
.airy-close-btn svg { width: 24px; height: 24px; }
.airy-share-list { display: flex; flex-direction: column; gap: 0; }
.airy-share-item { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid #f0f0f0; font-size: 15px; font-weight: 500; color: #000000; cursor: pointer; transition: opacity 0.2s; background: transparent; border-top: none; border-left: none; border-right: none; text-decoration: none; }
.airy-share-item:last-child { border-bottom: none; padding-bottom: 0; }
.airy-share-item:first-child { padding-top: 0; }
.airy-share-item:hover { opacity: 0.6; }
.airy-share-icon { display: flex; align-items: center; justify-content: center; color: #000000; }
.airy-share-icon svg { width: 20px; height: 20px; }
.share-text { font-family: inherit; }

/* ==========================================================================
   F. RESPONSIVE GLOBAL
   ========================================================================== */
@media(max-width: 992px) {
    .mapi-tiles-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; margin-top: -40px; }
    .mapi-hero-txt h1 { font-size: 2em !important; }
    .mapi-hero-full { height: 350px !important; }
    .p3-equip-list { grid-template-columns: 1fr; }
    .mapi-action-top { flex-direction: column; align-items: stretch !important; }
    .mapi-action-top button, .mapi-action-top a { width: 100%; margin-top: 15px; }
    .mapi-layout-3col { display: flex; flex-direction: column; }
    .mapi-col-left { order: 3; }
    .mapi-col-center { order: 1; }
    .mapi-col-right { order: 2; }
}

@media(max-width: 768px) {
    .mapi-hero-full { margin-top: -150px; padding-top: 200px; padding-bottom: 60px; height: auto; min-height: 350px; }
    .mapi-row, .mapi-row3 { grid-template-columns: 1fr; }
    .mapi-form-container { margin-top: -40px !important; padding: 25px !important; }
    .mapi-chat-wrapper { padding: 20px; }
    .mapi-chat-replies { margin-left: 20px; padding-left: 10px; }
    .mapi-topo-card { margin-bottom: 20px; }
    .mapi-btn-group-apple { flex-direction: column-reverse; gap: 10px; }
    .mapi-btn-apple { width: 100% !important; }
}

/* ==========================================================================
   BOUCLIER ANTI-THEME (BLOCKSY) - SUPPRESSION DE L'ANIMATION ROUGE
   ========================================================================== */
.mapi-chat-send::before, .mapi-chat-send::after,
.mapi-btn-apple-cancel::before, .mapi-btn-apple-cancel::after,
.mapi-btn-apple-submit::before, .mapi-btn-apple-submit::after,
.airy-btn-submit::before, .airy-btn-submit::after,
.airy-btn-cancel::before, .airy-btn-cancel::after {
    display: none !important;
    content: none !important;
}