/* ==========================================================================
   MMFR Activity - centre d'activité moderne
   ========================================================================== */

.mmfr-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 22px;
    box-sizing: border-box;
    background: rgba(7, 25, 41, .72);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.mmfr-modal-box {
    width: min(1060px, 100%);
    max-height: min(88vh, 860px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 22px 70px rgba(7, 25, 41, .34);
    animation: mmfrModalPop .18s ease-out;
}

@keyframes mmfrModalPop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.mmfr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    background-color: #2a5a8c;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.mmfr-modal-titlebox {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.mmfr-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
}

.mmfr-modal-icon .icon,
.mmfr-modal-icon i,
.mmfr-modal-icon svg {
    margin: 0 !important;
    color: #ffffff !important;
    fill: #ffffff !important;
}

.mmfr-modal-header h3 {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 950 !important;
    line-height: 1.15;
    border: 0 !important;
    text-transform: none !important;
}

.mmfr-modal-header p {
    margin: 4px 0 0 !important;
    color: rgba(255, 255, 255, .78);
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.25;
}

.mmfr-modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.mmfr-action-btn,
.mmfr-modal-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 11.5px;
    font-weight: 900;
    line-height: 32px;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: none;
}

.mmfr-action-dark {
    background: rgba(7, 25, 41, .44);
}

.mmfr-action-blue {
    background: rgba(70, 136, 206, .92);
}

.mmfr-action-red {
    background: rgba(212, 17, 66, .92);
}

.mmfr-modal-close {
    width: 32px;
    padding: 0;
    background: rgba(255, 255, 255, .13);
}

.mmfr-action-btn:hover,
.mmfr-modal-close:hover {
    filter: brightness(1.05);
}

.mmfr-action-btn .icon,
.mmfr-modal-close .icon,
.mmfr-action-btn i,
.mmfr-modal-close i,
.mmfr-action-btn svg,
.mmfr-modal-close svg {
    margin: 0 !important;
    color: #ffffff !important;
    fill: #ffffff !important;
}

/* Body */
.mmfr-modal-body {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
    gap: 18px;
    padding: 18px;
    overflow-y: auto;
    background: #f6f8fb;
}

.mmfr-activity-main,
.mmfr-activity-section {
    min-width: 0;
    border: 1px solid #d6e0ea;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(17, 48, 74, .055);
}

.mmfr-activity-main {
    padding: 16px;
}

.mmfr-activity-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.mmfr-activity-section {
    padding: 15px;
}

.mmfr-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
}

.mmfr-section-head h4 {
    margin: 0 !important;
    color: #11304a !important;
    font-size: 13px !important;
    font-weight: 950 !important;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .35px;
    border: 0 !important;
}

.mmfr-section-head span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e8eff5;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

/* Timeline */
.mmfr-activity-timeline,
.mmfr-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mmfr-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 11px;
    padding: 0 0 16px;
    color: #334155;
}

.mmfr-timeline-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 18px;
    bottom: -2px;
    width: 2px;
    background: #e2e8f0;
}

.mmfr-timeline-item:last-of-type {
    padding-bottom: 0;
}

.mmfr-timeline-item:last-of-type::before {
    display: none;
}

.mmfr-timeline-dot {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    border-radius: 999px;
    background: #4688ce;
    box-shadow: 0 0 0 4px rgba(70, 136, 206, .13);
}

.mmfr-timeline-item.type-reply .mmfr-timeline-dot {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.mmfr-timeline-item.type-topic .mmfr-timeline-dot {
    background: #d41142;
    box-shadow: 0 0 0 4px rgba(212, 17, 66, .12);
}

.mmfr-timeline-content {
    min-width: 0;
    padding: 12px 13px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.mmfr-timeline-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.mmfr-type-pill,
.badge-msg,
.badge-user {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    line-height: 20px;
    text-transform: uppercase;
    letter-spacing: .25px;
    white-space: nowrap;
}

.mmfr-type-pill {
    background: #225682;
}

.type-reply .mmfr-type-pill,
.badge-msg {
    background: #4688ce;
}

.type-topic .mmfr-type-pill {
    background: #d41142;
}

.type-user .mmfr-type-pill,
.badge-user {
    background: #10b981;
}

.mmfr-timeline-meta .time {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.mmfr-timeline-text {
    color: #334155;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.mmfr-timeline-text a,
.mmfr-activity-list a {
    color: #11304a;
    font-weight: 900;
    text-decoration: none;
}

.mmfr-timeline-text a:hover,
.mmfr-activity-list a:hover {
    color: #d41142;
    text-decoration: underline;
}

/* Side cards */
.mmfr-activity-list {
    display: grid;
    gap: 10px;
}

.mmfr-post-card,
.mmfr-user-card {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px 12px;
    border-radius: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.mmfr-post-title {
    display: block;
    min-width: 0;
    color: #11304a !important;
    font-size: 13px;
    font-weight: 950 !important;
    line-height: 1.28;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mmfr-post-meta,
.mmfr-user-card small {
    color: #64748b;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.25;
}

.mmfr-user-card > span:not(.badge-user) {
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

/* New items */
.mmfr-nouveau {
    background-color: #fff1f2 !important;
    border-color: rgba(212, 17, 66, .24) !important;
}

/* Fallback */
.mmfr-empty-fallback {
    display: none;
    color: #94a3b8;
    font-style: italic;
    font-size: 12px;
    padding: 8px 0;
}

/* Topic preview */
.mmfr-topic-preview {
    position: absolute;
    z-index: 10050;
    display: none;
    max-width: calc(100vw - 24px);
    padding: 13px 14px;
    box-sizing: border-box;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #d6e0ea;
    box-shadow: 0 18px 42px rgba(17, 48, 74, .22);
    color: #334155;
    pointer-events: none;
}

.mmfr-topic-preview.is-visible {
    display: block;
}

.mmfr-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.mmfr-preview-head strong {
    min-width: 0;
    color: #11304a;
    font-size: 13px;
    font-weight: 950;
    line-height: 1.25;
}

.mmfr-preview-head span {
    flex: 0 0 auto;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 10.5px;
    font-weight: 850;
    text-transform: uppercase;
}

.mmfr-topic-preview p {
    margin: 0;
    color: #334155;
    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.45;
}

.mmfr-topic-preview small {
    display: block;
    margin-top: 9px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 750;
}

/* Mobile */
@media (max-width: 820px) {
    .mmfr-modal-overlay {
        padding: 10px;
        align-items: flex-start;
    }

    .mmfr-modal-box {
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .mmfr-modal-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px;
    }

    .mmfr-modal-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .mmfr-action-btn {
        min-height: 30px;
        padding: 0 9px;
        font-size: 10.5px;
    }

    .mmfr-modal-body {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }

    .mmfr-activity-main,
    .mmfr-activity-section {
        border-radius: 14px;
    }

    .mmfr-post-title {
        white-space: normal;
    }
}

@media (max-width: 460px) {
    .mmfr-modal-titlebox {
        align-items: flex-start;
    }

    .mmfr-modal-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .mmfr-action-btn span {
        display: none;
    }

    .mmfr-modal-close {
        margin-left: auto;
    }
}

/* ==========================================================================
   MMFR Activity - ajustements V9
   Top badges calqué sur les tables exactes de l'extension badges.
   ========================================================================== */

.mmfr-title-separator {
    color: #94a3b8;
    font-weight: 900;
    margin: 0 2px;
}

.mmfr-timeline-text .mmfr-preview-link::before {
    content: "↪";
    display: inline-block;
    margin: 0 6px 0 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

/* Timeline : couleurs par type */
.mmfr-timeline-item.type-reply .mmfr-timeline-dot {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.mmfr-timeline-item.type-topic .mmfr-timeline-dot {
    background: #4688ce;
    box-shadow: 0 0 0 4px rgba(70, 136, 206, .13);
}

.mmfr-timeline-item.type-poi .mmfr-timeline-dot,
.mmfr-timeline-item.type-gpx .mmfr-timeline-dot {
    background: #92400e;
    box-shadow: 0 0 0 4px rgba(146, 64, 14, .13);
}

.mmfr-timeline-item.type-vehicle .mmfr-timeline-dot {
    background: #374151;
    box-shadow: 0 0 0 4px rgba(55, 65, 81, .13);
}

.mmfr-timeline-item.type-badge .mmfr-timeline-dot {
    background: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .13);
}

.mmfr-timeline-item.type-delete .mmfr-timeline-dot,
.mmfr-timeline-item.type-moderation .mmfr-timeline-dot {
    background: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .13);
}

.mmfr-timeline-item.type-reply .mmfr-type-pill {
    background: #10b981;
}

.mmfr-timeline-item.type-topic .mmfr-type-pill {
    background: #4688ce;
}

.mmfr-timeline-item.type-poi .mmfr-type-pill,
.mmfr-timeline-item.type-gpx .mmfr-type-pill {
    background: #92400e;
}

.mmfr-timeline-item.type-vehicle .mmfr-type-pill {
    background: #374151;
}

.mmfr-timeline-item.type-badge .mmfr-type-pill {
    background: #7c3aed;
}

.mmfr-timeline-item.type-delete .mmfr-type-pill,
.mmfr-timeline-item.type-moderation .mmfr-type-pill {
    background: #dc2626;
}

/* Sections membres */
.mmfr-member-stats,
.mmfr-latest-members {
    display: grid;
    gap: 10px;
}

.mmfr-member-card,
.mmfr-latest-member-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-width: 0;
    padding: 12px 13px;
    border-radius: 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.mmfr-member-main {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.mmfr-member-name {
    min-width: 0;
    color: #11304a;
    font-size: 13.5px;
    font-weight: 950;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.mmfr-member-meta {
    color: #64748b;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.25;
}

.mmfr-member-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.mmfr-mini-badge {
    display: inline-flex;
    align-items: center;
    min-height: 19px;
    padding: 0 7px;
    border-radius: 999px;
    background: #e8eff5;
    color: #11304a;
    font-size: 10px;
    font-weight: 900;
    line-height: 19px;
    white-space: nowrap;
}

.mmfr-mini-badge.is-garage {
    background: #e8eff5;
    color: #11304a;
}

.mmfr-mini-badge.is-messages {
    background: #efe4ff;
    color: #5b21b6;
}

.mmfr-mini-badge.is-presence {
    background: #ffe3ee;
    color: #be185d;
}

.mmfr-mini-badge.is-map {
    background: #e0fbff;
    color: #0e7490;
}

.mmfr-mini-badge.is-gpx {
    background: #e7f9ef;
    color: #15803d;
}

.mmfr-mini-badge.is-empty {
    color: #94a3b8;
    background: #eef2f6;
}

.mmfr-member-count {
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 13px;
    background: #11304a;
    color: #ffffff;
    font-size: 16px;
    font-weight: 950;
    box-shadow: 0 4px 12px rgba(17, 48, 74, .12);
}

.mmfr-top-badge-card .mmfr-member-count {
    background: #7c3aed;
}

.mmfr-latest-member-card {
    grid-template-columns: 1fr;
}

.mmfr-latest-member-card .mmfr-member-meta {
    margin-top: 1px;
}

/* Aperçu désactivé sur mobile/tactile */
@media (hover: none), (pointer: coarse), (max-width: 760px) {
    .mmfr-topic-preview,
    .mmfr-topic-preview.is-visible {
        display: none !important;
    }
}

@media (max-width: 820px) {
    .mmfr-member-card {
        grid-template-columns: 1fr;
    }

    .mmfr-member-count {
        justify-self: start;
        width: auto;
        min-width: 0;
        height: 26px;
        padding: 0 10px;
        font-size: 12px;
        border-radius: 999px;
    }

    .mmfr-member-count::after {
        content: " badge(s)";
        margin-left: 4px;
        font-size: 10px;
        font-weight: 800;
    }
}
