/* ---------- BASE ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #020617;
    --bg-alt: #020617;
    --card: #0b1120;
    --card-alt: #020617;
    --border-subtle: #1e293b;
    --accent: #0ea5e9;
    --accent-2: #22c55e;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --danger: #ef4444;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.65);
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0f172a 0, #020617 45%, #000 100%);
    color: var(--text);
    min-height: 100vh;
}

/* ---------- PAGE WRAPPER & HEADER ---------- */

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.page-header {
    margin-bottom: 24px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap; 
}

h1 {
    font-size: 2rem;
    letter-spacing: 0.03em;
}

.header-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.95rem;
}

.header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.badge-soft {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(34, 197, 94, 0.12));
}

/* ---------- CONTAINER ---------- */

.container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- FORM CARD ---------- */

.search-card {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 55%),
                radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.07), transparent 50%),
                var(--card);
    border-radius: var(--radius-lg);
    padding: 20px 20px 18px;
    border: 1px solid rgba(30, 64, 175, 0.7);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.search-card-header {
    margin-bottom: 12px;
}

.search-card-header h2 {
    font-size: 1.15rem;
    margin-bottom: 2px;
}

.search-hint {
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- FORM GRID ---------- */

.header-title-block {
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

.header-links-centered {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.header-links-centered {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

@media (max-width: 768px) {
    .header-links-centered {
        gap: 8px;
    }

    .header-title-block h1 {
        font-size: 1.8rem;
    }
}


.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
    margin-top: 10px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    color: #cbd5f5;
    margin-bottom: 4px;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--muted);
}

.checkbox-inline input {
    margin: 0;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #1e293b;
    background: rgba(15, 23, 42, 0.85);
    color: var(--text);
    font-size: 0.92rem;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.05s;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 1);
    transform: translateY(-1px);
}

.hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
}

/* Genres : select + bouton */

.genre-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.genre-row select {
    flex: 1;
}

.btn-chip {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.12s ease;
}

.btn-chip:hover {
    background: rgba(30, 64, 175, 0.9);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.7);
    transform: translateY(-1px);
}

/* Chips genres sélectionnés */

.chip-container {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.6);
    font-size: 0.78rem;
}

.chip button {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
}

/* ---------- BUTTONS ---------- */

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

button {
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.15s ease, opacity 0.12s ease;
}

button:disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none !important;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #020617;
    font-weight: 600;
    box-shadow: 0 12px 25px rgba(22, 163, 74, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(22, 163, 74, 0.55);
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.7);
    color: var(--muted);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-ghost:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.95);
}

/* ---------- INFO BAR ---------- */

.info-bar {
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    border: 1px solid rgba(51, 65, 85, 0.9);
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- PAGINATION ---------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.pagination-bottom {
    margin-top: 14px;
}

.btn-page {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.btn-page:hover:not(:disabled) {
    background: rgba(30, 64, 175, 0.9);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.7);
    transform: translateY(-1px);
}

.page-info {
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- RESULTS GRID ---------- */

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 6px;
}

.card {
    position: relative;
    background: linear-gradient(145deg, #020617, #020617);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid #1f2937;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.65);
    display: flex;
    flex-direction: column;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border 0.12s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.9);
    border-color: rgba(56, 189, 248, 0.75);
}

.card img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* Badge de note */

/* Badge de note */

.card-rating {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(56, 189, 248, 0.7);
    font-size: 0.78rem;
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-rating span.star {
    font-size: 0.9rem;
    color: #facc15;   /* étoile jaune = note fiable (>= 1000 votes) */
}

/* Variante : note avec peu de votes */

.card-rating-weak {
    border-color: rgba(148, 163, 184, 0.7);
    opacity: 0.9;
}

.card-rating-weak .star-weak {
    font-size: 0.9rem;
    color: var(--muted);     /* gris */
}


.card-body {
    padding: 10px 11px 12px;
}

.card-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.card-overview {
    font-size: 0.78rem;
    color: #cbd5f5;
    max-height: 3.8em;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- EMPTY / STATUS ---------- */

.results p {
    font-size: 0.9rem;
}

.status-message {
    font-size: 0.9rem;
    color: var(--muted);
}

/* ---------- OVERLAY DÉTAILS ---------- */

.overlay[hidden] {
    display: none;
}

.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
}

.overlay-content {
    position: relative;
    max-width: 900px;
    width: 95vw;
    max-height: 90vh;
    background: #020617;
    border-radius: 18px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
    padding: 16px 16px 18px;
    overflow: hidden;
    z-index: 101;
}

.overlay-body {
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow-y: auto;
    max-height: calc(90vh - 40px);
}

.overlay-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--muted);
    font-size: 0.9rem;
}

.overlay-poster {
    flex: 0 0 260px;
}

.overlay-poster img {
    width: 100%;
    border-radius: 12px;
}

.overlay-main {
    flex: 1;
    min-width: 0;
}

.overlay-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.overlay-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.overlay-rating {
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.overlay-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 4px;
}

.overlay-overview {
    font-size: 0.85rem;
    color: #e5e7eb;
}

.overlay-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8rem;
}

.overlay-chip {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.9);
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-wrapper {
        padding-inline: 12px;
    }

    .overlay-body {
        flex-direction: column;
    }

    .overlay-poster {
        flex: 0 0 auto;
        max-width: 260px;
        margin: 0 auto;
    }
}

/* AUTOCOMPLETE ACTEURS */
.suggestions {
    position:absolute;
    top: 68px;
    left:0;
    right:0;
    background:#1e293b;
    border:1px solid #334155;
    border-radius:8px;
    z-index:50;
    max-height:180px;
    overflow-y:auto;
}

.suggestions div {
    padding:8px 12px;
    cursor:pointer;
}

.suggestions div:hover {
    background:#334155;
}

/* DROPDOWN GENRES */
.dropdown {
    position:relative;
}

.dropdown-btn {
    width:100%;
    padding:8px;
    background:#0f172a;
    border:1px solid #334155;
    border-radius:8px;
    color:white;
    cursor:pointer;
    text-align:left;
}

.dropdown-content {
    position:absolute;
    top:48px;
    left:0;
    right:0;
    background:#1e293b;
    border:1px solid #334155;
    border-radius:8px;
    padding:8px;
    display:none;
    max-height:220px;
    overflow-y:auto;
    z-index:100;
}

.dropdown-content label {
    display:flex;
    align-items:center;
    gap:8px;
    padding:6px;
    cursor:pointer;
}

.dropdown-content label:hover {
    background:#334155;
}

.dropdown.open .dropdown-content {
    display:block;
}

.movie-icons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.movie-icons span {
    font-size: 22px;
    cursor: pointer;
    user-select: none;
    text-shadow: 0 0 6px rgba(0,0,0,0.8);
    transition: transform 0.15s, color 0.15s;
}

.movie-icons span:hover {
    transform: scale(1.25);
}

.icon-heart.activated {
    color: #ff4d6d; /* rouge */
}

.icon-eye.activated {
    color: #7dd3fc; /* bleu clair */
}

/* Conteneur des boutons du header */
.header-links {
    display: flex;
    flex-wrap: wrap;          /* ✅ les boutons peuvent revenir à la ligne */
    gap: 10px;
    align-items: center;
    max-width: 100%;          /* ne dépasse jamais la largeur de l’écran */
}

/* Chaque bouton "pill" */
.header-link {
    border: 1px solid #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #bbf7d0;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, transform 0.1s;
    flex: 0 1 auto;           /* peut rétrécir si besoin */
    white-space: nowrap;      /* le texte reste sur une ligne à l’intérieur du bouton */
}


.header-link:hover {
    background: rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
}

/* Cartes vues (grisé) */
.card.card-seen img {
    filter: grayscale(1);
    opacity: 0.4;
}

.card.card-seen {
    opacity: 0.8;
}

/* Carte vue (grisé) */
.card.card-seen {
    opacity: 0.55;
    filter: grayscale(100%);
}

/* Pour garantir que l'image est bien grisée */
.card.card-seen img {
    filter: grayscale(100%) brightness(0.6);
}

.card {
    position: relative;
    /* ... ton style existant ... */
}

/* Voile gris pour "vus" */
.card-seen {
    opacity: 0.6;
    filter: grayscale(0.7);
}

/* Carte ignorée : on ne filtre plus la carte elle-même */
.card-ignored {
    position: relative;
    overflow: hidden;
}

/* On grise seulement l'affiche */
.card-ignored img {
    filter: grayscale(100%) brightness(0.5);
}

/* Grand X rouge bien visible */
.card-ignored .ignored-x {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 180px;

    /* 🔴 Rouge visible */
    color: rgba(220, 40, 40, 0.6);

    pointer-events: none;
    user-select: none;
    z-index: 999;
}



.overlay-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.overlay-btn {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    background: #1f2937;
    color: #f9fafb;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.1s, background 0.15s;
}

.overlay-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.overlay-btn.active {
    background: #10b981;
    opacity: 1;
}

.overlay-nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.overlay-nav-btn {
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    background: #111827;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 0.85rem;
}

.overlay-nav-info {
    font-size: 0.85rem;
    color: #9ca3af;
}

@media (max-width: 480px) {
    .header-inner {
        justify-content: center;
        text-align: center;
    }

    .header-links {
        justify-content: center;
    }
}

.card-badge-other {
    position: absolute;
    top: 36px;          /* juste sous le badge de note */
    left: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.9);
    color: #022c22;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
}

/* === Overlay auth : carte & layout === */

#authOverlay .auth-card {
    max-width: 420px;
    width: 90%;
    background: radial-gradient(circle at top left, #1f2937, #020617);
    border-radius: 18px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
    position: relative;
    color: #e5e7eb;
}

#authOverlay .overlay-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    cursor: pointer;
}

#authOverlay .overlay-close:hover {
    background: rgba(30, 64, 175, 0.9);
}

#authOverlay .auth-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.auth-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
    margin: 2px 0 10px;
}

/* Tabs Connexion / Inscription */

.auth-tabs {
    display: flex;
    padding: 3px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    margin-bottom: 8px;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: #9ca3af;
    padding: 6px 0;
    border-radius: 999px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-tab-active {
    background: linear-gradient(90deg, #22c55e, #06b6d4);
    color: #020617;
    font-weight: 600;
}

/* Formulaires */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.auth-form label {
    font-size: 0.8rem;
    color: #cbd5f5;
}

.auth-form input {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    font-size: 0.9rem;
    outline: none;
}

.auth-form input::placeholder {
    color: #6b7280;
}

.auth-form input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.auth-submit {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

/* Message d'erreur / info */

.auth-message {
    font-size: 0.8rem;
    color: #fca5a5;
    margin-top: 4px;
    min-height: 1em;
}

/* Champs de l’overlay auth */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

/* Ligne label + "mot de passe oublié ?" */
.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Lien "Mot de passe oublié ?" */
.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: #a5b4fc;          /* violet clair ; change si tu veux */
    cursor: pointer;
    text-decoration: underline;
}

.auth-link-btn:hover {
    color: #c4b5fd;
}

/* Bouton "Se connecter" bien large comme avant */
.auth-submit {
    margin-top: 8px;
    width: 100%;
}

/* ===== OVERLAY GROUPE ===== */

.group-overlay-content {
    max-width: 640px;
}

.group-overlay-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.group-subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 4px;
}

.group-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1f2937;
}

.group-block {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(15,23,42,0.85);
    border: 1px solid #1f2937;
}

.group-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
}

.group-label input {
    margin-top: 2px;
}

.group-members-list,
.group-invites-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.group-member-item,
.group-invite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background-color: #020617;
}

.group-member-main,
.group-invite-main {
    display: flex;
    flex-direction: column;
}

.group-member-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.group-member-email {
    font-size: 0.8rem;
    color: #9ca3af;
}

.group-member-badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

.group-member-actions,
.group-invite-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.group-chip {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: #1f2937;
    color: #e5e7eb;
}

.btn-ghost-small,
.btn-danger-small {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: transparent;
    cursor: pointer;
}

.btn-danger-small {
    border-color: #f97373;
    color: #fecaca;
}

.btn-ghost-small:hover {
    background: #111827;
}

.btn-danger-small:hover {
    background: #7f1d1d;
}

.group-invite-form {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.group-invite-form input {
    flex: 1;
}

.group-message {
    font-size: 0.8rem;
    margin-top: 4px;
    color: #fbbf24;
}

.group-empty {
    font-size: 0.8rem;
    color: #6b7280;
}

.group-danger {
    border-color: #7f1d1d;
    background: rgba(127,29,29,0.1);
}

.group-danger-text {
    font-size: 0.8rem;
    color: #fca5a5;
    margin-top: 4px;
}

.btn-danger {
    width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #ef4444;
    background: transparent;
    color: #fecaca;
    cursor: pointer;
}

.btn-danger:hover {
    background: #7f1d1d;
}

/* Placeholders plus gris et transparents */
::placeholder {
    color: rgba(148, 163, 184, 0.35);  /* gris clair + très transparent */
    opacity: 1; /* nécessaire sur Firefox */
}

/* Pour compatibilité multi-navigateurs */
input::-webkit-input-placeholder { 
    color: rgba(148, 163, 184, 0.35);
}

input::-moz-placeholder {
    color: rgba(148, 163, 184, 0.35);
}

input:-ms-input-placeholder {
    color: rgba(148, 163, 184, 0.35);
}

input::-ms-input-placeholder {
    color: rgba(148, 163, 184, 0.35);
}

.film-by-film-bar {
    margin: 8px 0 4px;
    display: flex;
    justify-content: flex-start;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    background: #1d1f27;
    color: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.modal-tabs {
    display: flex;
    margin: 16px 0;
    border-bottom: 1px solid #333;
}

.tab-btn {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-weight: 500;
}

.tab-btn.active {
    color: #fff;
    border-bottom: 2px solid #4caf50;
}

.tab-panel {
    display: none;
    margin-top: 10px;
}

.tab-panel.active {
    display: block;
}

.group-form .form-group {
    margin-bottom: 12px;
}

.group-form input,
.group-form textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #151720;
    color: #fff;
}

.btn-primary {
    background: #4caf50;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover {
    background: #43a047;
}

.invitation-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.invitation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.invitation-info small {
    color: #aaa;
}

.invitation-actions {
    display: flex;
    gap: 6px;
}

.btn-icon {
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
}

.btn-accept {
    background: #4caf50;
}

.btn-accept:hover {
    background: #43a047;
}

.btn-decline {
    background: #f44336;
}

.btn-decline:hover {
    background: #e53935;
}

/* Champ email dans "Inviter un membre" */
#groupInviteEmail {
    color: #f9fafb;                 /* texte bien visible */
    background-color: #020617;      /* même fond que ta carte */
    border: 1px solid #334155;
}

/* Placeholder un peu plus clair mais lisible */
#groupInviteEmail::placeholder {
    color: #64748b;
    opacity: 1;
}

.header-link-group {
    position: relative;
}

/* Petit badge rouge rond pour le nombre d'invitations */
.badge-invite {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background-color: #ef4444;  /* rouge */
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #020617; /* bord sombre pour bien détacher sur le fond */
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6);
}

/* Ligne membre */
.member-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 10px;
}

/* Email en plus discret */
.member-email {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Style des lignes d'amis dans la liste */
.group-members-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 6px 10px;
    margin-bottom: 6px;

    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(51, 65, 85, 0.9);

    font-size: 0.95rem;
    color: #e5e7eb;
}

/* Nom d'ami plus lisible */
.group-members-list li .friend-name {
    font-weight: 500;
}

/* Bouton de suppression dans la liste d'amis */
.group-members-list li button {
    border-radius: 9999px;
    padding: 4px 9px;
    font-size: 0.8rem;
    line-height: 1;
}

.group-members-list li:last-child {
    border-bottom: none;
}

/* Bouton suppression */
.member-remove-btn {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: 0.15s;
}

.member-remove-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* ===== GLOBAL LOADER ===== */

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* Spinner */
.loader-spinner {
    width: 70px;
    height: 70px;
    border: 6px solid rgba(255,255,255,0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.movie-release-info {
    margin-top: 4px;
    font-size: 0.85rem;
    color: #facc15; /* jaune doux, tu peux adapter */
}

/* ===================== */
/* OVERLAY AMIS MODERNE  */
/* ===================== */

.friends-overlay-content {
    max-width: 900px;
    width: 100%;
    background: #0b1120;
    border-radius: 18px;
    padding: 20px 24px 24px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.65);
    position: relative;
}

.friends-overlay-inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Titre centré */
.friends-header {
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.friends-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.friends-subtitle {
    margin-top: 4px;
    font-size: 0.95rem;
    color: #9ca3af;
}

/* Layout colonnes */
.friends-layout {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    align-items: stretch;
}

/* Colonne gauche = plus large */
.friends-column-main {
    flex: 1.3;
}

/* Colonne droite = plus petite */
.friends-column-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Blocs */
.friends-block {
    background: rgba(15, 23, 42, 0.95);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(51, 65, 85, 0.8);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.friends-block-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #e5e7eb;
}

/* Corps des blocs (scroll pour les listes) */
.friends-block-body {
    margin-top: 4px;
    font-size: 0.92rem;
}

/* Liste d'amis scrollable */
.friends-list-body {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Liste des invitations scrollable si besoin */
.friends-requests-body {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Petits ajustements existants */
.group-members-list,
.group-invitations-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.group-empty {
    color: #9ca3af;
    font-size: 0.9rem;
}

.group-message {
    font-size: 0.9rem;
}

/* Responsive : empile les colonnes sur mobile */
@media (max-width: 768px) {
    .friends-layout {
        flex-direction: column;
    }

    /* D'abord la colonne avec invitations + ajout d'amis */
    .friends-column-side {
        order: 1;
    }

    /* Ensuite la colonne avec la liste d'amis */
    .friends-column-main {
        order: 2;
    }

    .friends-block {
        padding: 10px 11px;
    }

    .friends-overlay-content {
        padding: 16px 14px 18px;
    }
}
.matches-card {
    margin-top: 16px;
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

.matches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
}

.matches-block {
    flex: 1 1 260px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.matches-friends-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}


/* Quand il n'y a rien dedans, on laisse la hauteur s’ajuster */
.matches-friends-container:empty {
    max-height: none;
    overflow: visible;
}


.matches-friends-select {
    width: 100%;
    background: #050814;       /* à adapter à ton thème */
    border-radius: 8px;
    border: 1px solid #1f2937;
    padding: 6px;
    color: #e5e7eb;
    font-size: 0.95rem;

    /* IMPORTANT : pas de hauteur fixe → pas de scrollbar inutile */
    max-height: 220px;
    overflow-y: auto;
}

.match-friend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.3);
    cursor: pointer;
    font-size: 0.9rem;
}

.match-friend-chip input {
    accent-color: #22c55e;
}

.match-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.6);
    font-size: 0.8rem;
    color: #bbf7d0;
}

/* Adaptation mobile : les blocs passent en colonne, et l'ordre naturel est OK */
@media (max-width: 768px) {
    .matches-grid {
        flex-direction: column;
    }
}

.matches-friend-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
}

.card-match-badge {
    margin-top: 4px;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(46, 204, 113, 0.15);
    color: #a8ffcf;
}
.matches-buttons-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.movie-match-banner {
    background: #222a;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 500;
}

#backToTopBtn {
    position: fixed;
    right: 20px;
    bottom: 25px;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 22px;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: 0.25s ease;
}

#backToTopBtn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-3px);
}

#backToTopBtn.show {
    display: flex;
}

.results-tabs {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.results-tab {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #444;
    background: #111;
    color: #eee;
    cursor: pointer;
    font-size: 0.9rem;
}

.results-tab-active {
    background: #f97316;
    border-color: #f97316;
    color: #111;
}
