/**
 * Babi Meet Premium — Extension Design System v3
 * Composants : Dashboard, Explore, Groupes, Profil, Premium, Skeletons
 */

/* ── Spacing scale ── */
:root {
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --sidebar-w: 272px;
}

/* ── Skeleton loaders ── */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.skeleton {
    background: var(--surface-2);
    animation: skeleton-pulse 1.4s ease infinite;
    border-radius: var(--radius-md);
}

.skeleton-welcome {
    height: 120px;
    margin-bottom: var(--space-5);
    border-radius: var(--radius-lg);
}

.skeleton-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.skeleton-stats .skeleton { height: 88px; }

.skeleton-card {
    aspect-ratio: 3/4.2;
    width: 100%;
    max-width: 400px;
    margin-inline: auto;
    border-radius: var(--radius-xl);
}

.skeleton-row {
    height: 72px;
    margin-bottom: var(--space-3);
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}

.skeleton-grid .skeleton { aspect-ratio: 3/4; }

/* ── Stagger animations ── */
.stagger-item {
    animation: slideUp 0.45s var(--ease-out) both;
}

.stagger-item:nth-child(1) { animation-delay: 0.04s; }
.stagger-item:nth-child(2) { animation-delay: 0.08s; }
.stagger-item:nth-child(3) { animation-delay: 0.12s; }
.stagger-item:nth-child(4) { animation-delay: 0.16s; }
.stagger-item:nth-child(5) { animation-delay: 0.20s; }
.stagger-item:nth-child(6) { animation-delay: 0.24s; }
.stagger-item:nth-child(7) { animation-delay: 0.28s; }
.stagger-item:nth-child(8) { animation-delay: 0.32s; }

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

.hover-lift {
    transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ── Welcome card ── */
.welcome-card {
    position: relative;
    overflow: hidden;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-5);
}

.welcome-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    filter: blur(30px);
}

.welcome-card-inner { position: relative; z-index: 1; }

.welcome-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2);
}

.welcome-card p {
    font-size: 0.9375rem;
    opacity: 0.92;
    margin-bottom: var(--space-4);
}

.welcome-card-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.btn-welcome {
    padding: 0.55rem 1.1rem;
    background: rgba(255,255,255,0.95);
    color: var(--brand);
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--duration-fast);
}

.btn-welcome:hover { transform: scale(1.04); }

.btn-welcome-ghost {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.35);
}

/* ── Stats 4 cols ── */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

@media (min-width: 540px) {
    .stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Profile completion ── */
.completion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.completion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.completion-header strong { font-size: 0.875rem; font-weight: 700; }
.completion-header span { font-size: 0.8125rem; color: var(--brand); font-weight: 700; }

.completion-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.completion-bar-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-out);
}

.completion-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.completion-task {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text-muted);
}

.completion-task.done {
    background: var(--brand-soft);
    color: var(--brand);
}

/* ── Suggestion cards ── */
.suggest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.suggest-card {
    border: none;
    padding: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform var(--duration-fast);
}

.suggest-card:hover { transform: scale(1.03); }

.suggest-card-photo {
    aspect-ratio: 3/4;
    background-size: cover;
    background-position: center;
    position: relative;
}

.suggest-compat {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 0.25rem 0.55rem;
    background: var(--glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}

.suggest-card-info {
    padding: var(--space-3);
}

.suggest-card-info strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
}

.suggest-card-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Discovery bookmark ── */
.btn-swipe.btn-bookmark {
    width: 48px;
    height: 48px;
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--border);
    font-size: 1.1rem;
}

.discovery-dock { gap: 0.85rem; flex-wrap: wrap; }

/* ── Explore immersive ── */
.explore-page { max-width: min(960px, 100%); }

.explore-hero {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.explore-tabs {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-4);
    scrollbar-width: none;
}

.explore-tabs::-webkit-scrollbar { display: none; }

.explore-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border: 1.5px solid #111;
    border-radius: var(--radius-full);
    background: #111;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--duration-fast);
}

.explore-tab.active {
    background: var(--primary, #DC143C);
    border-color: var(--primary, #DC143C);
    color: #fff;
}

.explore-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}

.explore-tab.active .explore-tab-count {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

[data-theme="dark"] .explore-tab {
    background: #000;
    border-color: #000;
    color: #fff;
}

[data-theme="dark"] .explore-tab-count {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

[data-theme="dark"] .explore-tab.active {
    background: var(--primary, #DC143C);
    border-color: var(--primary, #DC143C);
    color: #fff;
}

[data-theme="dark"] .explore-tab.active .explore-tab-count {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.explore-profiles-section {
    margin-top: var(--space-2);
}

.explore-grid-empty {
    grid-column: 1 / -1;
    padding: 2rem 1rem;
}

.explore-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.stories-scroll-premium {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    padding: var(--space-2) 0 var(--space-4);
    scroll-snap-type: x mandatory;
}

.story-ring-premium {
    flex-shrink: 0;
    scroll-snap-align: start;
    border: none;
    background: none;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}

.story-ring-premium .ring {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-full);
    padding: 3px;
    background: var(--gradient-brand);
    margin-bottom: var(--space-2);
}

.story-ring-premium .ring-inner {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background-size: cover;
    background-position: center;
    border: 2px solid var(--surface);
}

.story-ring-premium span {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 72px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-ring-premium .story-ring-sub {
    display: block;
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--text-muted);
    max-width: 72px;
    margin-top: 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.story-ring-premium.is-unseen .ring {
    background: var(--gradient-brand);
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.15);
}

.story-ring-premium.is-unseen .story-ring-sub {
    color: var(--brand);
}

.story-ring-premium.is-seen .ring {
    background: var(--border-strong);
}

.story-ring-premium.is-seen span,
.story-ring-premium.is-seen .story-ring-sub {
    color: var(--text-muted);
}

.story-ring-premium.story-ring-add .ring {
    background: var(--border-strong);
}

.story-ring-premium .ring-inner.story-ring-add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface) !important;
    border: 2px dashed var(--brand) !important;
    color: var(--brand);
}

.story-ring-premium .ring-inner.story-ring-add-icon i {
    font-family: "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--brand);
    pointer-events: none;
}

.ring-inner-fallback,
.avatar-fallback-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--primary-soft, #fde8ec) 0%, #f0e4e8 100%);
}

.avatar-fallback {
    font-weight: 800;
    color: var(--brand, #DC143C);
    letter-spacing: 0.03em;
    line-height: 1;
    user-select: none;
}

.avatar-fallback-story { font-size: 1.05rem; }
.avatar-fallback-tile {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
}
.avatar-fallback-sm { font-size: 0.72rem; }
.avatar-fallback-md { font-size: 0.95rem; }
.avatar-fallback-lg { font-size: 1.65rem; }
.avatar-fallback-xl { font-size: clamp(1.75rem, 6vw, 2.5rem); }
.avatar-fallback-disc { font-size: clamp(2rem, 12vw, 3.5rem); }

.disc-card-no-photo .disc-card-photo-wrap,
.disc-card-photo-wrap--empty {
    background: linear-gradient(145deg, var(--primary-soft, #fde8ec) 0%, #ebe0e4 100%);
}

.disc-card-fallback {
    width: 100%;
    height: 100%;
    min-height: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-popup-photo-fallback {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    margin: 0 auto 1rem;
}

.match-card-avatar.avatar-fallback-wrap,
.activity-avatar.avatar-fallback-wrap,
.conv-avatar.avatar-fallback-wrap,
.fav-card-photo.avatar-fallback-wrap,
.search-result-avatar.avatar-fallback-wrap,
.msg-conv-avatar.avatar-fallback-wrap,
.msg-chat-avatar.avatar-fallback-wrap,
.msg-profile-avatar.avatar-fallback-wrap,
.match-popup-photo-fallback.avatar-fallback-wrap {
    background: linear-gradient(145deg, var(--primary-soft, #fde8ec) 0%, #ebe0e4 100%);
}

.match-card-avatar.avatar-fallback-wrap .avatar-fallback-lg { font-size: 1.25rem; }
.fav-card-photo.avatar-fallback-wrap { position: relative; }

.lum-profile-avatar.avatar-fallback-wrap,
.story-author-avatar.avatar-fallback-wrap,
.drawer-user-avatar.avatar-fallback-wrap,
.notif-avatar.avatar-fallback-wrap,
.profile-grid-photo.avatar-fallback-wrap,
.event-participant-avatar.avatar-fallback-wrap,
.lum-profile-cover-fallback {
    background: linear-gradient(145deg, var(--primary-soft, #fde8ec) 0%, #ebe0e4 100%);
}

.lum-profile-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.story-author-row-inner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.profile-grid-photo-wrap {
    position: relative;
    aspect-ratio: 3/4;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.profile-page-own .lum-profile-cover-wrap {
    position: relative;
}

.profile-page-own .lum-profile-avatar-wrap {
    position: relative;
    width: fit-content;
    margin: 0 auto;
}

.profile-media-edit {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    border: none;
    z-index: 3;
    transition: background var(--duration-fast);
}

.profile-media-edit:hover {
    background: rgba(0, 0, 0, 0.72);
}

.profile-media-edit-cover {
    top: 0.75rem;
    right: 0.75rem;
}

.profile-media-remove {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
}

.profile-media-edit-avatar {
    right: 0;
    bottom: 0;
    transform: translate(25%, 25%);
}

.profile-photo-badge {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    z-index: 2;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    background: var(--brand);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
}

.profile-photo-set-primary {
    position: absolute;
    top: 0.35rem;
    left: 0.35rem;
    z-index: 2;
    width: 1.65rem;
    height: 1.65rem;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
}

.profile-photo-wrap {
    position: relative;
}


.explore-tile-no-photo {
    background: linear-gradient(145deg, var(--primary-soft, #fde8ec) 0%, #ebe0e4 100%) !important;
}

.explore-tile-no-photo::after {
    opacity: 0.28;
}

.dash-mini-avatar.avatar-fallback-wrap,
.dash-hero-match-photo.avatar-fallback-wrap,
.dash-profile-chip-avatar.avatar-fallback-wrap,
.dash-match-chip-avatar.avatar-fallback-wrap,
.lum-match-photo.avatar-fallback-wrap,
#sidebar-user-avatar.avatar-fallback-wrap {
    background: linear-gradient(145deg, var(--primary-soft, #fde8ec) 0%, #ebe0e4 100%);
}

.avatar-has-photo {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

span.avatar-has-photo,
span.avatar-fallback-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.explore-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (min-width: 640px) {
    .explore-masonry { grid-template-columns: repeat(3, 1fr); }
}

.explore-tile {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    border: none;
    padding: 0;
    background-color: var(--border);
}
.explore-tile-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.explore-tile-photo,
img.explore-tile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border: none;
}
.explore-tile::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
    pointer-events: none;
}
.explore-tile-label {
    position: absolute;
    bottom: var(--space-3);
    left: var(--space-3);
    right: var(--space-3);
    z-index: 2;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: left;
}
.explore-tile-badge {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2;
    padding: 0.25rem 0.55rem;
    background: #10b981;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.explore-tile-badge svg,
.explore-tile-badge .lucide-icon {
    stroke: #fff;
    color: #fff;
}

.explore-tile.tall { grid-row: span 1; }

/* ── Groups community ── */
.groups-hero {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-2);
}

.group-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.55rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.group-pill i { color: var(--brand); }

.group-card-premium {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-fast);
}

.group-card-premium:hover { transform: translateY(-2px); }

.group-card-premium .group-card-photo {
    aspect-ratio: 16/9;
    background-size: cover;
    position: relative;
}

.group-trending-badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    padding: 0.25rem 0.6rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.group-card-premium .group-card-body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    min-height: 108px;
}

.group-meta {
    display: flex;
    gap: var(--space-4);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: var(--space-2) 0 var(--space-3);
}

.group-list-premium {
    display: grid;
    gap: var(--space-4);
}

.group-list-scroll {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.group-list-scroll .group-card-premium {
    flex: 0 0 min(280px, 78vw);
    scroll-snap-align: start;
    cursor: pointer;
}

.group-section-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: -0.25rem 0 var(--space-4);
    line-height: 1.45;
}

.group-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0.5rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.group-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--brand);
    margin-top: auto;
}

.group-card-count {
    position: absolute;
    bottom: var(--space-3);
    left: var(--space-3);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.group-joined-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.group-my-section {
    margin-bottom: var(--space-5);
}

.group-my-scroll {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
}

.group-my-chip {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    width: 88px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.group-my-chip-photo {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    background: var(--surface-2) center / cover no-repeat;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border);
    transition: transform var(--duration-fast), border-color var(--duration-fast);
}

.group-my-chip:hover .group-my-chip-photo,
.group-my-chip:focus-visible .group-my-chip-photo {
    transform: translateY(-2px);
    border-color: var(--brand);
}

.group-my-chip-name {
    font-size: 0.6875rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    max-width: 88px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 640px) {
    .group-list-premium:not(.group-list-scroll) { grid-template-columns: repeat(2, 1fr); }
}

/* ── Matchs page sections ── */
.match-section {
    margin-bottom: var(--space-6);
}

.match-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.match-grid-cards {
    display: grid;
    gap: var(--space-3);
}

/* ── Profile premium ── */
.profile-hero-premium {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-lg);
}

.profile-cover-photo {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
}

.profile-hero-body {
    padding: var(--space-5);
    background: var(--surface);
    margin-top: -48px;
    position: relative;
}

.profile-avatar-large {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-full);
    border: 4px solid var(--surface);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-3);
}

.profile-hero-body h2 {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.profile-stat-box {
    text-align: center;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.profile-stat-box strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--brand);
}

.profile-stat-box span {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.profile-gallery-premium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.profile-gallery-premium .profile-photo-wrap {
    aspect-ratio: 3/4;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.profile-section-premium {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-sm);
}

.profile-section-premium h3 {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ── Premium conversion ── */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-6);
    font-size: 0.8125rem;
}

.compare-table th,
.compare-table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.compare-table th:first-child,
.compare-table td:first-child { text-align: left; }

.compare-table thead th {
    font-weight: 700;
    background: var(--surface-2);
}

.compare-table .col-premium {
    background: var(--gold-soft);
    color: var(--brand);
    font-weight: 600;
}

.testimonial-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
}

.testimonial-card p {
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: var(--space-2);
    font-style: italic;
    color: var(--text-secondary);
}

.testimonial-author {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    overflow: hidden;
    background: var(--surface);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    color: var(--text);
}

.faq-answer {
    padding: 0 var(--space-4) var(--space-4);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: none;
}

.faq-item.open .faq-answer { display: block; }
.faq-item.open .faq-question i { transform: rotate(180deg); }

/* ── Sidebar badges ── */
.sidebar-nav .nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav .nav-badge.pulse {
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 68, 88, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(255, 68, 88, 0); }
}

.sidebar-nav .nav-item .nav-icon-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast);
}

.sidebar-nav .nav-item.active .nav-icon-wrap {
    background: rgba(255, 255, 255, 0.18);
}

.sidebar-nav .nav-item:hover .nav-icon-wrap {
    background: var(--brand-soft);
}

/* ── Header premium CTA mobile ── */
.header-btn-premium-mobile {
    background: var(--gradient-premium) !important;
    color: #fff !important;
}

.btn-premium-header {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--gradient-premium);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast);
}

.btn-premium-header:hover { transform: scale(1.04); }

@media (max-width: 768px) {
    .btn-premium-header { display: inline-flex; }
}

/* ── Chat read receipts ── */
.chat-bubble-me .read-status {
    font-size: 0.625rem;
    opacity: 0.8;
    margin-top: 2px;
}

.chat-bubble-me .read-status.read { color: rgba(255,255,255,0.95); }

.msg-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.msg-tab {
    flex: 1;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
}

.msg-tab.active {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

/* ── Paywall Premium ── */
.paywall-wall {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-5);
    text-align: center;
    background: var(--gradient-premium);
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.paywall-wall::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.paywall-wall-inner { position: relative; z-index: 1; }

.paywall-wall-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: rgba(0,0,0,0.12);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.paywall-wall h2 {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.paywall-wall p {
    font-size: 0.9375rem;
    opacity: 0.88;
    line-height: 1.55;
    max-width: 320px;
    margin: 0 auto var(--space-5);
}

.paywall-blur-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    filter: blur(6px);
    opacity: 0.6;
    pointer-events: none;
}

.paywall-blur-card {
    aspect-ratio: 3/4;
    border-radius: var(--radius-md);
    background: #B8B8B8;
}

/* ── Notifications timeline ── */
.notif-filters {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    overflow-x: auto;
    scrollbar-width: none;
}

.notif-filters::-webkit-scrollbar { display: none; }

.notif-filter-btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    border: 1.5px solid #111;
    border-radius: var(--radius-full);
    background: #111;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--duration-fast);
}

.notif-filter-btn.active {
    background: var(--primary, #DC143C);
    border-color: var(--primary, #DC143C);
    color: #fff;
}

[data-theme="dark"] .notif-filter-btn {
    background: #000;
    border-color: #000;
    color: #fff;
}

[data-theme="dark"] .notif-filter-btn.active {
    background: var(--primary, #DC143C);
    border-color: var(--primary, #DC143C);
    color: #fff;
}

.notif-timeline { display: flex; flex-direction: column; gap: var(--space-2); }

.notif-timeline-group {
    margin-bottom: var(--space-4);
}

.notif-timeline-date {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
    padding-left: var(--space-1);
}

/* ── Favoris premium grid ── */
.fav-card-premium {
    position: relative;
    border: none;
    padding: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform var(--duration-fast);
}

.fav-card-premium:hover { transform: translateY(-4px); }

.fav-card-premium .fav-card-photo { aspect-ratio: 3/4; background-size: cover; background-position: center; position: relative; }

.fav-compat-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 0.25rem 0.55rem;
    background: var(--glass);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
}

.fav-online {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--surface);
    border-radius: var(--radius-full);
}

/* ── Settings sections ── */
.settings-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: var(--space-5) 0 var(--space-2);
    padding-left: var(--space-1);
}

.settings-section-label:first-child { margin-top: 0; }

/* ── Fade-in utility ── */
.fade-in { animation: fadeIn 0.35s var(--ease-out); }

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

.page-transition { animation: pageEnter 0.35s var(--ease-out); }

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

/* ── Layout : proportions par écran (shell pleine largeur) ── */
.app-main > .tab-page,
.app-main > .loading-state,
.app-main > .empty-state {
    align-self: center;
}

.discovery-card-photo {
    max-height: min(72vh, 620px);
}

.compare-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.profile-gallery-premium .profile-photo-wrap,
.fav-card-premium,
.suggest-card,
.explore-tile {
    min-width: 0;
}

.h-scroll,
.stories-scroll-premium,
.explore-tabs,
.notif-filters {
    max-width: 100%;
}

/* PWA + push prompts */
.push-prompt-banner,
.pwa-install-banner {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(520px, calc(100vw - 1.5rem));
    animation: pwaBannerIn 0.35s var(--ease, ease) both;
}

.push-prompt-banner-inner,
.pwa-install-banner-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.push-prompt-banner-inner i,
.pwa-install-banner-inner i {
    font-size: 1.25rem;
    color: var(--primary, #DC143C);
    flex-shrink: 0;
}

.push-prompt-banner-inner div,
.pwa-install-banner-inner div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.push-prompt-banner-inner strong,
.pwa-install-banner-inner strong {
    font-size: 0.875rem;
}

.push-prompt-banner-inner span,
.pwa-install-banner-inner span {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

.push-prompt-dismiss,
.pwa-install-dismiss {
    border: none;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}

@keyframes pwaBannerIn {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 640px) {
    .app-bottomnav ~ .push-prompt-banner,
    .app-bottomnav ~ .pwa-install-banner {
        bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Dark mode : contraste texte sur fonds clairs/sombres ── */
[data-theme="dark"] .disc-chip,
[data-theme="dark"] .lum-group-cover-badges span {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .msg-profile-chips .disc-chip {
    background: var(--primary-soft);
    color: var(--text-primary);
    border-color: rgba(220, 20, 60, 0.35);
}

[data-theme="dark"] .chip:not(.active) {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

[data-theme="dark"] .notif-item,
[data-theme="dark"] .notif-item-clickable {
    color: var(--text-primary);
}

[data-theme="dark"] .notif-body strong,
[data-theme="dark"] .notif-body p {
    color: inherit;
}

[data-theme="dark"] .fav-card-info strong,
[data-theme="dark"] .explore-tile-info strong,
[data-theme="dark"] .group-card-info strong,
[data-theme="dark"] .profile-tile-info strong {
    color: var(--text-primary);
}

[data-theme="dark"] button.match-card-premium {
    color: var(--text-primary);
}

[data-theme="dark"] .msg-conv.active .msg-conv-name {
    color: var(--text-primary);
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .field-input,
[data-theme="dark"] .field-textarea,
[data-theme="dark"] select.field-input {
    color: var(--text-primary);
    background: var(--surface-elevated);
}

[data-theme="dark"] .search-input::placeholder,
[data-theme="dark"] .field-input::placeholder,
[data-theme="dark"] .field-textarea::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .page-head-sub,
[data-theme="dark"] .muted {
    color: var(--text-muted);
}

[data-theme="dark"] .tag {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--border-strong);
}
