:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-hover: #222222;
    --bg-card: #1a1a1a;
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    --text-primary: #f0f0f0;
    --text-secondary: #888888;
    --text-muted: #555555;
    --accent-red: #e50914;
    --accent-blue: #0070f3;
    --accent-orange: #f5a623;
    --accent-purple: #7928ca;
    --accent-green: #00b341;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
    --nav-height: 60px;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.28);
    --container-width: 1400px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scrollbar-width: thin;
    scrollbar-color: #333333 #1a1a1a;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.modal-lock {
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition), opacity var(--transition), transform var(--transition);
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

ul,
ol {
    list-style: none;
}

main,
.site-main {
    min-height: calc(100vh - var(--nav-height));
}

.container {
    width: min(100% - 2rem, var(--container-width));
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
    border: 0;
}

/* =========================
   NAVIGATION
========================= */

.site-nav,
nav.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(26, 26, 26, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container,
.site-nav .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    padding: 0 2rem;
    position: relative;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.05rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.site-logo::first-letter {
    color: var(--accent-red);
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text-primary);
}

.nav-button,
.nav-links .nav-button,
.btn-nav,
.nav-links a.nav-button,
.nav-links a.nav-button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
}

.nav-button:hover,
.nav-links .nav-button:hover,
.btn-nav:hover,
.nav-links a.nav-button:hover,
.nav-links a.nav-button-danger:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.nav-button-danger {
    color: #ff6666;
}

.nav-burger,
.burger-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.nav-burger:hover,
.burger-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.nav-burger span,
.burger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 999px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: transform var(--transition), opacity var(--transition), top var(--transition), bottom var(--transition);
}

.nav-burger span:nth-child(1),
.burger-btn span:nth-child(1) {
    top: 12px;
}

.nav-burger span:nth-child(2),
.burger-btn span:nth-child(2) {
    top: 20px;
}

.nav-burger span:nth-child(3),
.burger-btn span:nth-child(3) {
    top: 28px;
}

/* =========================
   FLASH MESSAGES / ALERTS
========================= */

.flash-message {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: 1000;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.flash-message.success,
.flash-success {
    background: rgba(0, 179, 65, 0.2);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.flash-message.error,
.flash-error {
    background: rgba(229, 9, 20, 0.2);
    border: 1px solid var(--accent-red);
    color: #ff4d4d;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.alert {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.alert ul {
    list-style: disc;
    margin-left: 1.2rem;
}

.alert-error {
    background: rgba(229, 9, 20, 0.16);
    border-color: rgba(229, 9, 20, 0.5);
    color: #ff7a7a;
}

.alert-success {
    background: rgba(0, 179, 65, 0.16);
    border-color: rgba(0, 179, 65, 0.5);
    color: #49d17b;
}

/* =========================
   BUTTONS / FORMS
========================= */

.btn,
button.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    transition: background-color var(--transition), border-color var(--transition), transform var(--transition), color var(--transition), opacity var(--transition);
}

.btn:hover,
button.btn:hover,
a.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent-red);
    color: #ffffff;
    border-color: var(--accent-red);
}

.btn-primary:hover {
    background: #cc0812;
    border-color: #cc0812;
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-full {
    width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="file"],
textarea,
select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.12);
}

.form-help,
.form-help-row small,
.char-counter {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.form-help-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.search-input {
    width: 100%;
}

/* =========================
   AUTH PAGES
========================= */

.auth-page {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.auth-title,
.auth-card h1 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

.auth-form button[type="submit"] {
    width: 100%;
    background: var(--accent-red);
    color: #ffffff;
    border: none;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
}

.auth-form button[type="submit"]:hover {
    background: #cc0812;
}

.auth-link {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.auth-link a {
    color: var(--text-primary);
    font-weight: 500;
}

.auth-link a:hover {
    color: var(--accent-red);
}

/* =========================
   HOME / INDEX
========================= */

.hero,
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
}

.hero h1,
.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero p,
.hero-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.hero .btn,
.hero-button {
    display: inline-flex;
    margin-top: 1.5rem;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
}

.members-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2,
.members-section h2 {
    font-size: 1.45rem;
    font-weight: 600;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.member-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    display: block;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.member-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    background: var(--bg-hover);
}

.member-card-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.member-avatar,
.member-avatar-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.member-avatar-placeholder,
.member-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-red);
    margin: 0 auto;
    border: 1px solid rgba(229, 9, 20, 0.35);
}

.member-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.member-username {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.member-since {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.member-stats,
.member-stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-item,
.member-stat {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.6rem;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-value,
.member-stat-value {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.member-stat {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-align: left;
}

.member-stat-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-stat-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.member-stat-content {
    min-width: 0;
}

.member-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.stat-item.films .stat-value,
.member-stat-films .member-stat-value,
.member-stat-films .member-stat-icon {
    color: var(--accent-red);
}

.stat-item.series .stat-value,
.member-stat-series .member-stat-value,
.member-stat-series .member-stat-icon {
    color: var(--accent-blue);
}

.stat-item.animes .stat-value,
.member-stat-animes .member-stat-value,
.member-stat-animes .member-stat-icon {
    color: var(--accent-orange);
}

.stat-item.jeux .stat-value,
.member-stat-jeux .member-stat-value,
.member-stat-jeux .member-stat-icon {
    color: var(--accent-purple);
}

.empty-state {
    padding: 2rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01);
}

/* =========================
   PROFILE PAGE
========================= */

.profile-header,
.profile-header-section {
    padding: 2rem 0 1rem;
}

.profile-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.profile-header-top {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.profile-avatar,
.profile-avatar-large {
    width: 120px;
    height: 120px;
    flex: 0 0 120px;
}

.profile-avatar img,
.profile-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.profile-avatar-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.18);
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 600;
    border: 1px solid rgba(229, 9, 20, 0.35);
}

.profile-header-info,
.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-header-info h1,
.profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.15;
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    white-space: pre-line;
}

.profile-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.profile-stats,
.profile-stats-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-stat-badge {
    min-width: 110px;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.profile-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.profile-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
}

.badge-film {
    border-color: rgba(229, 9, 20, 0.35);
}

.badge-film .profile-stat-value {
    color: var(--accent-red);
}

.badge-serie {
    border-color: rgba(0, 112, 243, 0.35);
}

.badge-serie .profile-stat-value {
    color: var(--accent-blue);
}

.badge-anime {
    border-color: rgba(245, 166, 35, 0.35);
}

.badge-anime .profile-stat-value {
    color: var(--accent-orange);
}

.badge-jeu {
    border-color: rgba(121, 40, 202, 0.35);
}

.badge-jeu .profile-stat-value {
    color: var(--accent-purple);
}

.profile-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

#btn-add-media,
.btn-add-media {
    background: var(--accent-red);
    color: #ffffff;
    border: 1px solid var(--accent-red);
}

#btn-add-media:hover,
.btn-add-media:hover {
    background: #cc0812;
    border-color: #cc0812;
}

.profile-tabs-section {
    padding: 1rem 0 3rem;
}

.tabs-nav,
.profile-tabs-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn,
.profile-tab-button {
    position: relative;
    appearance: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.9rem 0.8rem;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.tab-btn:hover,
.profile-tab-button:hover {
    color: var(--text-primary);
}

.tab-btn.active,
.profile-tab-button.tab-active {
    color: var(--text-primary);
}

.tab-btn.active::after,
.profile-tab-button.tab-active::after {
    content: '';
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: -1px;
    height: 2px;
    background: var(--accent-red);
    border-radius: 999px;
}

.tab-panel,
.profile-tab-panel {
    display: none;
}

.tab-panel.active,
.profile-tab-panel.tab-panel-active {
    display: block;
}

.media-section,
.media-status-section {
    margin-bottom: 2rem;
}

.media-section-title,
.media-status-header h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.media-status-header {
    margin-bottom: 1rem;
}

.empty-media-message {
    color: var(--text-secondary);
    font-size: 0.92rem;
    padding: 0.85rem 0;
}

.media-list,
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.media-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-sm);
}

.media-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.media-card-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    background: #161616;
    overflow: hidden;
}

.media-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-card-cover-fallback {
    width: 100%;
    height: 100%;
    background: #2b2b2b;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.media-card-body {
    padding: 0.85rem;
}

.media-title,
.media-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.media-year,
.media-card-year {
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.media-rating,
.media-card-rating {
    color: #f6c453;
    font-size: 0.86rem;
    font-weight: 500;
}

.media-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.media-card.type-film,
.type-film {
    border-color: rgba(229, 9, 20, 0.12);
}

.media-card.type-serie,
.type-serie {
    border-color: rgba(0, 112, 243, 0.12);
}

.media-card.type-anime,
.type-anime {
    border-color: rgba(245, 166, 35, 0.12);
}

.media-card.type-jeu,
.type-jeu {
    border-color: rgba(121, 40, 202, 0.12);
}

.media-card-actions {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 2;
}

.media-action-button,
.btn-delete,
.btn-status,
.media-action-delete,
.media-action-status,
.media-action-rating {
    min-width: 38px;
    min-height: 32px;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(15, 15, 15, 0.8);
    color: #ffffff;
    font-size: 0.78rem;
    backdrop-filter: blur(4px);
}

.media-action-button:hover,
.btn-delete:hover,
.btn-status:hover,
.media-action-delete:hover,
.media-action-status:hover,
.media-action-rating:hover {
    background: rgba(34, 34, 34, 0.95);
}

.media-action-delete,
.btn-delete {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.35);
}

.status-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    min-width: 130px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    z-index: 20;
}

.status-option {
    width: 100%;
    padding: 0.65rem 0.8rem;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.status-option:last-child {
    border-bottom: none;
}

.status-option:hover {
    background: var(--bg-hover);
}

/* =========================
   MODAL
========================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.modal-open {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

.modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: 1.4rem;
    line-height: 1;
}

.modal-close:hover {
    background: var(--bg-hover);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.type-btns,
.media-type-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.type-btn,
.media-type-button {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
}

.type-btn:hover,
.media-type-button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.type-btn.active,
.media-type-button.media-type-active[data-type="film"] {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.type-btn[data-type="serie"].active,
.media-type-button.media-type-active[data-type="serie"] {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.type-btn[data-type="anime"].active,
.media-type-button.media-type-active[data-type="anime"] {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.type-btn[data-type="jeu"].active,
.media-type-button.media-type-active[data-type="jeu"] {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.search-bar-group {
    display: flex;
    gap: 0.75rem;
}

.search-results {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 72px;
    background: rgba(255, 255, 255, 0.01);
}

.search-results-grid {
    display: grid;
    gap: 0;
}

.search-result-card {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition);
}

.search-result-card:hover {
    background: var(--bg-hover);
}

.search-result-card:last-child {
    border-bottom: none;
}

.search-result-cover {
    width: 70px;
    height: 105px;
    flex: 0 0 70px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #2a2a2a;
}

.search-result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    padding: 0.5rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.search-result-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.search-result-body h3 {
    font-size: 0.98rem;
    line-height: 1.3;
}

.search-result-body p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.search-message,
.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.search-message-error {
    color: #ff7a7a;
}

.spinner {
    width: 26px;
    height: 26px;
    margin: 0 auto 0.6rem;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.selected-media-preview {
    margin-top: 0.25rem;
}

.selected-media-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.selected-media-cover {
    width: 64px;
    height: 96px;
    flex: 0 0 64px;
    background: #2a2a2a;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.selected-media-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-media-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    padding: 0.4rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.selected-media-info h3 {
    font-size: 0.98rem;
    margin-bottom: 0.2rem;
}

.selected-media-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.modal-add-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* range input */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    padding: 0.35rem 0;
    border: none;
    box-shadow: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background: #2d2d2d;
    border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--accent-red);
    border: none;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

input[type="range"]::-moz-range-track {
    height: 6px;
    background: #2d2d2d;
    border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-red);
    border: none;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

/* =========================
   SETTINGS PAGE
========================= */

.settings-page {
    padding: 2rem 0 3rem;
}

.settings-header {
    margin-bottom: 1.5rem;
}

.settings-header h1 {
    font-size: 2rem;
    line-height: 1.2;
}

.settings-cards {
    display: grid;
    gap: 1.5rem;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.settings-card-header {
    margin-bottom: 1.25rem;
}

.settings-card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.settings-form .btn {
    margin-top: 0.5rem;
}

.avatar-settings-block {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1rem;
}

.settings-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.current-avatar-image,
.avatar-preview-image,
#avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
    background: #1f1f1f;
}

.avatar-preview-wrapper {
    margin-top: 1rem;
}

.char-counter {
    white-space: nowrap;
}

/* =========================
   FOOTER
========================= */

.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.site-footer p {
    text-align: center;
}

/* =========================
   404 / ERROR PAGES
========================= */

.not-found-page {
    padding: 4rem 0;
}

.not-found-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.not-found-card h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.not-found-card p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

/* =========================
   HELPERS
========================= */

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.dropdown-open {
    display: block;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    .nav-container,
    .site-nav .nav-container {
        padding: 0 1rem;
    }

    .nav-burger,
    .burger-btn {
        display: inline-flex;
    }

    .nav-menu {
        position: static;
    }

    .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        display: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.5rem 1rem 1rem;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a,
    .nav-links .nav-button,
    .nav-links a.nav-button,
    .nav-links a.nav-button-danger {
        width: 100%;
        justify-content: flex-start;
        padding: 0.9rem 0.5rem;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        border-radius: 0;
        background: transparent;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .hero,
    .hero-section {
        padding: 3rem 1rem;
    }

    .hero h1,
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .members-section {
        padding: 1.25rem 1rem;
    }

    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .profile-header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-header-actions {
        justify-content: center;
    }

    .profile-stats-badges {
        justify-content: center;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .media-card-actions {
        flex-direction: row;
        top: auto;
        right: 0.5rem;
        bottom: 0.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.25rem;
    }

    .search-bar-group {
        flex-direction: column;
    }

    .search-result-card {
        gap: 0.75rem;
    }

    .search-result-cover {
        width: 58px;
        height: 87px;
        flex-basis: 58px;
    }

    .avatar-settings-block {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .flash-message {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        max-width: none;
    }

    .form-help-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .profile-header-card,
    .settings-card,
    .modal-content,
    .member-card {
        padding: 1rem;
    }

    .tabs-nav,
    .profile-tabs-nav {
        gap: 0.25rem;
    }

    .tab-btn,
    .profile-tab-button {
        padding-inline: 0.55rem;
        font-size: 0.9rem;
    }
}

@media (min-width: 1200px) {
    .profile-header-card {
        padding: 2rem;
    }

    .settings-card {
        padding: 2rem;
    }

    .hero-content {
        max-width: 840px;
    }
}
/* === BOUTON OPTIONS CARTE MÉDIA === */
.media-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.media-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.75);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
}

.media-action-btn:hover {
    background: rgba(229,9,20,0.85);
    border-color: #e50914;
    transform: scale(1.1);
}

/* === MENU CONTEXTUEL === */
.ctx-menu {
    position: absolute;
    z-index: 9999;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    animation: ctx-appear 0.12s ease;
}

@keyframes ctx-appear {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ctx-menu-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
    padding: 4px 10px 2px;
}

.ctx-menu-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 6px 0;
}

.ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.ctx-menu-item:hover {
    background: #2a2a2a;
    color: #fff;
}

.ctx-menu-item.menu-item-active {
    color: #e50914;
}

.ctx-menu-item-danger {
    color: #ff4d4d !important;
}

.ctx-menu-item-danger:hover {
    background: rgba(229,9,20,0.15) !important;
}

.menu-check {
    width: 14px;
    font-size: 0.8rem;
    color: #e50914;
}

/* Slider de note dans le menu */
.ctx-menu-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
}

.ctx-rating-slider {
    flex: 1;
    height: 4px;
    accent-color: #e50914;
    cursor: pointer;
}

.ctx-rating-value {
    font-size: 0.82rem;
    color: #f5a623;
    font-weight: 600;
    min-width: 44px;
    text-align: right;
}