/* =====================================================
   matching.css — Système d'intérêt mutuel
   ===================================================== */

/* ── Variables locales ── */
:root {
    --match-green   : #0A1628;
    --match-red     : #e74c3c;
    --match-orange  : #f39c12;
    --match-purple  : #9b59b6;
    --card-radius   : 16px;
    --card-shadow   : 0 4px 20px rgba(0,0,0,.08);
}

/* ── Page wrapper ── */
.matching-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

/* ── En-tête ── */
.matching-header {
    text-align: center;
    margin-bottom: 2rem;
}

.matching-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--color-primary, #0A1628);
    margin-bottom: .3rem;
}

.matching-subtitle {
    color: var(--color-text-light, #666);
    font-size: .95rem;
}

/* ── Onglets ── */
.matching-tabs {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.matching-tabs .tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.3rem;
    border-radius: 50px;
    background: #f5f5f5;
    color: #555;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    transition: all .2s ease;
    border: 2px solid transparent;
}

.matching-tabs .tab:hover {
    background: #e8f5e9;
    color: var(--color-primary, #0A1628);
}

.matching-tabs .tab.active {
    background: var(--color-primary, #0A1628);
    color: #fff;
    border-color: var(--color-primary, #0A1628);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 50px;
    background: rgba(255,255,255,.3);
    font-size: .72rem;
    font-weight: 700;
}

.tab.active .badge {
    background: rgba(255,255,255,.3);
}

.badge--alert {
    background: #e74c3c;
    color: #fff;
}

/* ── Grille de cartes ── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* ── Carte ── */
.interest-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    display: flex;
    flex-direction: column;
}

.interest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
}

.interest-card--match {
    border: 2px solid var(--match-green);
}

/* ── Photo ── */
.card-photo-link { display: block; }

.card-photo {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #f0f0f0;
}

.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.interest-card:hover .card-photo img {
    transform: scale(1.04);
}

.card-photo--blurred img {
    filter: blur(6px) brightness(.9);
}

/* Badges sur la photo */
.match-badge,
.pending-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: .3rem .9rem;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.match-badge {
    background: var(--match-green);
    color: #fff;
}

.pending-label {
    background: rgba(0,0,0,.55);
    color: #fff;
}

/* ── Corps de la carte ── */
.card-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
}

.card-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.card-name a {
    color: inherit;
    text-decoration: none;
}

.card-name a:hover {
    color: var(--color-primary, #0A1628);
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.card-meta span {
    font-size: .78rem;
    color: #666;
    background: #f5f5f5;
    padding: .2rem .6rem;
    border-radius: 50px;
}

.card-date {
    font-size: .75rem;
    color: #999;
    margin: 0;
}

/* ── Actions ── */
.card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

/* ── Badges de statut ── */
.status-badge {
    display: inline-block;
    padding: .25rem .7rem;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 600;
}

.status-badge--match   { background: #E8EEF5; color: #0A1628; }
.status-badge--declined{ background: #fadbd8; color: #922b21; }
.status-badge--pending { background: #fef9e7; color: #7d6608; }

/* ── Boutons (complément du CSS global) ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all .18s ease;
    line-height: 1;
}

.btn--sm       { padding: .4rem .8rem; font-size: .8rem; }
.btn--primary  { background: var(--color-primary,#0A1628); color:#fff; border-color: var(--color-primary,#0A1628); }
.btn--primary:hover { filter: brightness(1.1); }
.btn--success  { background: var(--match-green); color:#fff; }
.btn--success:hover { background: #1E3A5F; }
.btn--danger   { background: var(--match-red); color:#fff; }
.btn--danger:hover  { background: #c0392b; }
.btn--outline  { background: transparent; border-color: #ccc; color: #555; }
.btn--outline:hover { border-color: var(--color-primary,#0A1628); color: var(--color-primary,#0A1628); }
.btn--ghost    { background: transparent; color: #999; }
.btn--ghost:hover   { color: var(--match-red); }

/* ── État vide ── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #888;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: .5rem;
    color: #444;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: .95rem;
}

/* ── Toast notification ── */
.nournikah-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #222;
    color: #fff;
    padding: .75rem 1.5rem;
    border-radius: 50px;
    font-size: .9rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
    white-space: nowrap;
    max-width: 90vw;
    text-align: center;
}

.nournikah-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nournikah-toast.toast--success { background: var(--match-green); }
.nournikah-toast.toast--error   { background: var(--match-red); }
.nournikah-toast.toast--match   { background: var(--match-purple); }

/* ── Modal Match ── */
.match-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn .25s ease;
}

@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.match-modal__inner {
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity:0 }
    to   { transform: translateY(0);    opacity:1 }
}

.match-modal__icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: pulse 1s ease infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1) }
    to   { transform: scale(1.12) }
}

.match-modal__title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-primary, #0A1628);
    margin-bottom: .5rem;
}

.match-modal__text {
    color: #555;
    font-size: .95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.match-modal__actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .card-body { padding: .8rem; }

    .matching-tabs { gap: .3rem; }
    .matching-tabs .tab { padding: .5rem .9rem; font-size: .82rem; }
}
