@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap');

:root {
    --background-color: #141414;
    --dark-color: #1E1E1E;
    --main-color: #E84545;
    --white-100: #FFFFFF;
    --white-02: rgba(255, 255, 255, 0.02);
    --white-04: rgba(255, 255, 255, 0.04);
    --white-10: rgba(255, 255, 255, 0.1);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-40: rgba(255, 255, 255, 0.4);
    
    /* Variables responsive pour le nombre de colonnes */
    --films-per-row: 5;
    --film-card-width: 255px;
    --film-gap: 55px;
}

html {
    min-height: 100vh;
}

body {
    background-color: var(--background-color);
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0; /* no padding-based spacer */
    min-height: 100vh;
    box-sizing: border-box;
}

/* Small footer spacer area */
.site-footer {
    height: 80px;
}

/* Fallback spacing if no footer is present or not rendered */
body::after {
    content: "";
    display: block;
    height: 60px;
}

/* Auth pages: disable page scrollbar and footer spacer when requested */
body.auth-noscroll { overflow: hidden; }
body.no-footer-spacing::after { height: 0; }

/* ===== Welcome title ===== */
.welcome {
    text-align: center;
    color: white;
}

/* ===== Auth / Inscription page ===== */
.auth-page {
    min-height: calc(100vh - 85px); /* subtract header height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

.auth-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    width: 100%;
    max-width: 960px;
    background: #141414;
    border: 2px solid var(--main-color);
    border-radius: 30px;
    overflow: hidden; /* clip inner corners */
    box-shadow: 0 20px 60px rgba(232, 69, 69, 0.15), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-aside {
    min-height: 520px;
    background: url('../css/img/alaune.png') center/cover no-repeat;
    position: relative;
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20,20,20,0.0) 0%, rgba(20,20,20,0.4) 60%, rgba(20,20,20,0.8) 100%),
                linear-gradient(90deg, rgba(20,20,20,0.4) 0%, rgba(20,20,20,0.0) 35%);
}

.auth-box {
    width: 100%;
    max-width: 560px;
    background: #141414;
    border: none; /* border is on .auth-card */
    border-radius: 0;
    padding: 24px 24px 28px 24px;
    box-sizing: border-box;
}

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 18px;
    border-radius: 9999px;
    color: var(--white-100);
    background: transparent;
    border: 1px solid var(--white-10);
    font-weight: 700;
    transition: all 0.2s ease;
}

.auth-tab:hover { transform: translateY(-1px); }

.auth-tab.active {
    background: var(--main-color);
    border-color: transparent;
}

.auth-title {
    color: var(--white-100);
    text-align: center;
    font-size: 28px;
    width: calc(100% + 30px); /* extend field by 30px in X */
    margin-left: -15px; /* keep it centered inside the box */
    margin-right: -15px;
    margin: 0 0 6px 0;
}

.auth-subtitle {
    color: var(--white-40);
    text-align: center;
    font-size: 14px;
    margin: 0 0 16px 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-label {
    color: var(--white-100);
    font-weight: 600;
    font-size: 14px;
}

.auth-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    background-color: var(--white-04);
    border: 1px solid var(--white-10);
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-icon {
    position: absolute;
    left: 10px; /* 10px from the left edge of the field */
    top: 50%;
    transform: translateY(-50%); /* vertical center in 40px height */
    width: 20px;
    height: 20px;
}

.auth-input,
.auth-select {
    width: 100%;
    height: 100%;
    padding-left: 40px;
    padding-right: 40px; /* room for custom arrow */
    background: transparent;
    border: none;
    outline: none;
    color: var(--white-100);
    font-size: 16px;
    font-weight: bold;
    font-family: 'Open Sans', sans-serif;
}

.auth-input::placeholder {
    color: var(--white-40);
}

.auth-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--white-04); /* ensure same bg as field */
    border: 1px solid var(--white-10);
    border-radius: 10px;
    /* custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
}

/* hide default arrow on old IE/Edge */
.auth-select::-ms-expand { display: none; }

/* dropdown entries colors (supported in most modern browsers) */
.auth-select option,
.auth-select optgroup {
    background-color: var(--white-04);
    color: var(--white-100);
}

/* selected option: grey bg like others, red text */
.auth-select option:checked {
    background-color: var(--white-04);
    color: var(--main-color);
}

/* focused/keyboard-nav and hover: red bg, white text (override OS blue) */
.auth-select option:focus {
    background-color: var(--main-color);
    color: var(--white-100);
}

/* hovered option: force brand red instead of OS blue (where supported) */
.auth-select option:hover,
.auth-select option:active {
    background-color: var(--main-color);
    color: var(--white-100);
}

/* focus ring consistent with brand */
.auth-select:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(232, 69, 69, 0.2);
}

/* Custom Select (enhanced) */
.auth-field.has-custom-select { position: relative; }
.auth-field.has-custom-select .auth-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.cs-select { position: relative; width: 100%; height: 100%; }

/* Trigger (closed state) matches input look and aligns text with icon */
.cs-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding-left: 40px; /* room for .auth-icon at 10px */
    padding-right: 12px; /* no custom arrow, tighter right padding */
    background: transparent;
    color: var(--white-100);
    font-size: 16px;
    font-weight: bold;
    font-family: 'Open Sans', sans-serif;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

/* Text inside trigger: single line with ellipsis */
.cs-text {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown panel */
.cs-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--background-color);
    border: 1px solid var(--white-10);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    display: none;
    z-index: 1000;
    overflow: hidden; /* clip inner scroll corners */
    background-clip: padding-box;
}

/* Inner scrolling area to avoid grey corner bleed */
.cs-dropdown-inner {
    padding: 10px;
    max-height: 320px; /* JS may override via inline style */
    overflow-y: auto;
    background: var(--background-color);
}

.cs-select.open .cs-dropdown { display: block; }

/* Arrange options like film tags */
.cs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cs-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7.5px;
    background-color: var(--background-color);
    color: var(--white-100);
    border: 1px solid var(--main-color);
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    box-sizing: border-box;
    min-height: 32px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.cs-option:hover,
.cs-option:focus-visible {
    background: var(--main-color);
    color: var(--white-100);
    outline: none;
}

.cs-option.is-selected {
    background: var(--white-04);
    color: var(--white-100);
}

/* Apply the same red focus glow to all fields when focused */
.auth-field:focus-within {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(232, 69, 69, 0.2);
}

/* Fix Chrome/Edge autofill white background on dark inputs */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-select:-webkit-autofill,
.search input:-webkit-autofill,
.search input:-webkit-autofill:hover,
.search input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--white-100) !important;
    caret-color: var(--white-100);
    background-color: transparent !important;
    -webkit-box-shadow: 0 0 0 1000px var(--white-04) inset !important;
    box-shadow: 0 0 0 1000px var(--white-04) inset !important;
    background-clip: padding-box !important;
    border-radius: 10px; /* keep same radius as field */
    -webkit-transition: background-color 999999s ease-in-out 0s !important;
    transition: background-color 999999s ease-in-out 0s !important;
}

.filter{
    max-width: 35px;
}

/* Firefox autocomplete background override */
input.auth-input:-moz-ui-autofill,
select.auth-select:-moz-ui-autofill,
.search input:-moz-ui-autofill {
    box-shadow: 0 0 0 1000px var(--white-04) inset !important;
    -moz-text-fill-color: var(--white-100) !important;
    color: var(--white-100) !important;
}

.auth-submit {
    width: 100%; /* override .button width */
    margin-top: 6px;
}

/* Submit button on auth form: keep native border off, let .button/.button-fill hover apply */
.auth-form .button.button-fill.auth-submit {
    border: 0;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-clip: padding-box;
}

@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
        max-width: 560px;
    }
    .auth-aside { display: none; }
}

.auth-footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-link {
    color: var(--white-100);
    font-weight: 700;
}

.auth-link.muted { color: var(--white-40); font-weight: 600; font-size: 12px; }

a {
    text-decoration: none;
}

header {
    display: flex;
    align-items: center;
    height: 85px;
    width: 100%;
    background-color: var(--background-color);
    padding: 0 50px;
    box-sizing: border-box;
}

.header-logo {
    width: 28px;
    height: 31px;
    margin-right: 15px;
}

.header-brand {
    color: var(--white-100);
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 2px;
    display: inline-block;
    margin-right: auto;
}

.header-nav {
    display: flex;
    gap: 40px;
    align-items: center;
    flex: 1;
    justify-content: space-evenly;
    max-width: 600px;
}

/* Search group container - holds filter and search together */
.header-search-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    margin-right: 20px;
}

/* Filter button - positioned before search bar */
.header-filter {
    flex-shrink: 0;
}

.filter-button {
    background: var(--white-04);
    border: 2px solid var(--white-10);
    border-radius: 25px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 44px;
    min-width: 44px;
}

.filter-button:hover {
    background: var(--white-10);
    border-color: var(--white-20);
    transform: translateY(-2px);
}

.filter-button:active {
    transform: translateY(0);
}

.filter-icon {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
}

.header-search {
    margin: 0;
}

/* Filter Popup */
.filter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.filter-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(8px);
}

.filter-popup-content {
    position: relative;
    background: var(--background-color);
    border-radius: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(232, 69, 69, 0.15), 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--main-color);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.filter-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid var(--white-10);
}

.filter-popup-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--main-color);
    margin: 0;
}

.filter-popup-close {
    background: none;
    border: none;
    color: var(--white-100);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.filter-popup-close:hover {
    background: var(--white-10);
    color: var(--main-color);
    transform: rotate(90deg);
}

.filter-popup-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.filter-popup-body::-webkit-scrollbar {
    width: 8px;
}

.filter-popup-body::-webkit-scrollbar-track {
    background: var(--white-04);
    border-radius: 10px;
}

.filter-popup-body::-webkit-scrollbar-thumb {
    background: var(--white-20);
    border-radius: 10px;
}

.filter-popup-body::-webkit-scrollbar-thumb:hover {
    background: var(--main-color);
}

.filter-group {
    margin-bottom: 30px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--white-100);
    margin-bottom: 15px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 18px;
    background: var(--white-04);
    border: 2px solid var(--white-10);
    border-radius: 25px;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-checkbox:hover {
    background: var(--white-10);
    border-color: var(--white-20);
    transform: translateY(-2px);
}

.filter-checkbox input[type="checkbox"] {
    margin: 0;
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--main-color);
}

.filter-checkbox span {
    font-size: 14px;
    font-weight: 600;
    color: var(--white-100);
}

.filter-checkbox input[type="checkbox"]:checked {
    background-color: var(--main-color);
}

.filter-checkbox:has(input[type="checkbox"]:checked) {
    background: var(--main-color);
    border-color: var(--main-color);
    box-shadow: 0 4px 12px rgba(232, 69, 69, 0.4);
}

.filter-checkbox:has(input[type="checkbox"]:checked) span {
    color: var(--white-100);
    font-weight: 700;
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-range span {
    color: var(--white-40);
    font-size: 18px;
    font-weight: 600;
}

.filter-input {
    flex: 1;
    background: var(--white-04);
    border: 2px solid var(--white-10);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--white-100);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-input:focus {
    outline: none;
    background: var(--white-10);
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(232, 69, 69, 0.1);
}

.filter-input::placeholder {
    color: var(--white-30);
    font-weight: 400;
}

.filter-popup-footer {
    display: flex;
    gap: 15px;
    padding: 20px 30px;
    border-top: 2px solid var(--white-10);
    background: var(--dark-color);
}

.filter-popup-footer .button {
    flex: 1;
    text-align: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border: none;
}

.filter-popup-footer .button-stroke {
    border: none;
    background: var(--white-04);
}

.filter-popup-footer .button-stroke:hover {
    background: var(--white-10);
}

.filter-popup-footer .button-fill {
    border: none;
}

/* Placeholder used when search is absent: reserve same width and hide content */
.header-search.header-search--placeholder {
    width: 280px; /* default search width */
    visibility: hidden;
}

/* Match placeholder width to responsive search widths */
@media (max-width: 1279px) and (min-width: 1024px) {
    .header-search.header-search--placeholder { width: 240px; }
}
@media (max-width: 1023px) and (min-width: 768px) {
    .header-search.header-search--placeholder { width: 200px; }
}
@media (max-width: 767px) {
    .header-search.header-search--placeholder { width: 100%; }
}

.header-button {
    width: 140px;
}

/* FILMS A LA UNE */
.films-une-container {
    width: calc((var(--film-card-width) * var(--films-per-row)) + (var(--film-gap) * (var(--films-per-row) - 1)));
    max-width: 95vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 30px;
}

.film-une {
    position: relative;
    width: 100%;
    display: none;
}

.film-une.active {
    display: block;
}

.film-une-image {
    width: 100%;
    height: auto;
    border-radius: 30px;
    display: block;
}

.film-une-box {
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    background-color: #141414;
    border-radius: 30px;
    padding: 30px 50px;
    max-width: 600px;
}

.film-une-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0px;
}

.film-une-icon {
    width: 40px;
    height: 40px;
}

.film-une-label {
    color: var(--main-color);
    font-size: 30px;
    font-weight: bold;
}

.film-une-title {
    color: #FFFFFF;
    font-size: 50px;
    font-weight: bold;
    margin: 0;
    padding-left: 0px;
}

.film-une-description {
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    line-height: 1.4;
}

.film-une-buttons {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    justify-content: space-between;
    align-items: center;
}

.film-une-buttons .button {
    height: 40px;
}

.film-une-buttons .button-fill {
    width: 160px;
}

.film-duration-btn {
    width: auto !important;
    margin-left: auto;
    padding: 6px 14px !important;
    min-width: 72px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    border-radius: 10px !important;
    border: 2px solid var(--white-10) !important;
    background: transparent !important;
    color: var(--white-100) !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

.dots-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    z-index: 10;
}

.button {
    display: flex;
    width: 140px;
    height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-fill {
    background-color: var(--main-color);
    color: var(--white-100);
}

.button-fill:hover {
    background-color: #ff5555;
    box-shadow: 0 4px 12px rgba(232, 69, 69, 0.4);
}

.button-lock {
    background-color: var(--white-02);
    color: var(--white-20);
    border: 2px solid var(--white-04);
    transition: none;
}

.button-lock:hover {
    transform: none;
}

.button-stroke {
    background-color: var(--white-04);
    color: var(--white-100);
    border: 2px solid var(--white-10);
}

.button-stroke:hover {
    background-color: var(--white-10);
    border-color: var(--white-30);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.link {
    display: flex;
    color: var(--white-100);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.link:hover{
    transform: translateY(-2px);
}

.link-selected {
    display: inline-block;
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 2px;
}

.logo {
    width: 28px;
    height: 31px;
}

.search {
    position: relative;
    display: flex;
    align-items: center;
    width: 280px;
    height: 40px;
    background-color: var(--white-04);
    border: 1px solid var(--white-10);
    border-radius: 10px;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    left: 10px;
    width: 20px;
    height: 20px;
}

.search input {
    width: 100%;
    height: 100%;
    padding-left: 40px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--white-100);
    font-size: 16px;
    font-weight: bold;
    font-family: 'Open Sans', sans-serif;
}

.search input::placeholder {
    color: var(--white-40);
}

.auth-field.search {
    width: 100%;
    height: 44px;
    margin-left: -5px;
    margin-right: -15px;
}

.dot {
    width: 20px;
    height: 20px;
    background-color: var(--white-30);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot-selected {
    background-color: var(--main-color);
}

/* Categorie Container */
.categorie {
    width: 100%;
    margin-bottom: 50px;
    display: block;
}

.categorie-title {
    color: var(--white-100);
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left;
    padding-left: max(20px, calc((100vw - ((var(--film-card-width) * var(--films-per-row)) + (var(--film-gap) * (var(--films-per-row) - 1)))) / 2));
    display: block;
    white-space: nowrap;
}

/* Film Grid Container */
.film-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: var(--film-gap);
    width: calc((var(--film-card-width) * var(--films-per-row)) + (var(--film-gap) * (var(--films-per-row) - 1)));
    max-width: 95vw;
    margin: 0 auto;
}

/* Film Card - État normal */
.film-card {
    position: relative;
    width: var(--film-card-width);
    height: 290px;
    border: 2px solid var(--white-10);
    border-radius: 10px;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
    overflow: visible;
    transition: all 0.3s ease;
    z-index: 1;
}

.film-card:hover {
    z-index: 100;
}

.film-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.film-card:hover .film-card-image {
    opacity: 0;
}

.film-title-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 185px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(20, 20, 20, 0.9);
    border: 2px solid var(--main-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.film-title-top span {
    color: var(--white-100);
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.film-progress-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 185px;
    height: 5px;
    background-color: var(--background-color);
    border-radius: 5px 5px 0 0;
    transition: opacity 0.3s ease;
}

.film-progress-bar {
    height: 100%;
    background-color: var(--main-color);
    border-radius: 5px 5px 0 0;
    transition: width 0.3s ease;
}

/* Film Card - État hover */
.film-card-hover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 310px;
    min-height: 200px;
    background-color: var(--background-color);
    border: 2px solid var(--main-color);
    border-radius: 20px;
    box-sizing: border-box;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.film-card:hover .film-card-hover {
    opacity: 1;
    pointer-events: all;
}

.film-card:hover .film-title-top,
.film-card:hover .film-progress-container {
    opacity: 0;
}

.film-hover-title {
    color: var(--main-color);
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.film-hover-description {
    color: var(--white-40);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    padding-right: 0;
}

.film-hover-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.film-public, .film-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7.5px;
    background-color: var(--white-04);
    color: var(--white-100);
    border: 2px solid var(--white-10);
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    box-sizing: border-box;
}

.film-hover-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.film-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7.5px;
    background-color: var(--background-color);
    color: var(--white-100);
    border: 1px solid var(--main-color);
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
    box-sizing: border-box;
}

.film-hover-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
}

.film-btn-watch {
    width: 130px;
    height: 35px;
    background-color: var(--main-color);
    color: var(--white-100);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.film-btn-watch:hover {
    background-color: #ff5555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 69, 69, 0.4);
}

.film-btn-details {
    width: 130px;
    height: 35px;
    background-color: var(--white-04);
    color: var(--white-100);
    border: 2px solid var(--white-10);
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.film-btn-details:hover {
    background-color: var(--white-10);
    border-color: var(--white-30);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Bouton favori */
.film-favorite-form{
    margin: 0;
    padding: 0;
    display: inline-block;
    line-height: 0;
}

.film-favorite-btn {
    /* reset and force fully transparent background for submit button */
    all: unset;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    display: inline-block !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
    transition: transform 0.15s ease !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.film-favorite-btn:hover,
.film-favorite-btn:focus,
.film-favorite-btn:active {
    transform: scale(1.05) !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.film-favorite-icon {
    width: 40px;
    height: 40px;
    display: block;
    pointer-events: none;
}

/* États des favoris */
.film-favorite-fill .film-favorite-icon,
.film-favorite-stroke .film-favorite-icon {
    /* use the <img> src in HTML; ensure the element is visible */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 40px !important;
    height: 40px !important;
}

/* Extra specific reset for submit button to override any UA styles */
form.film-favorite-form > button[type="submit"].film-favorite-btn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    outline: none !important;
}

form.film-favorite-form > button[type="submit"].film-favorite-btn::-moz-focus-inner {
    border: 0 !important;
    padding: 0 !important;
}

/* ensure even browser default focus styles don't show a white ring */
form.film-favorite-form > button[type="submit"].film-favorite-btn:focus {
    box-shadow: 0 0 0 2px rgba(232,69,69,0) !important;
}

/* ============================================ */
/* MEDIA QUERIES POUR RESPONSIVE DESIGN */
/* ============================================ */

/* Extra Large Desktops (1920px et plus) - 5 colonnes */
@media (min-width: 1920px) {
    :root {
        --films-per-row: 5;
        --film-gap: 55px;
    }
}

/* Large Desktops (1600px - 1919px) - 4 colonnes */
@media (max-width: 1919px) and (min-width: 1600px) {
    :root {
        --films-per-row: 4;
        --film-gap: 50px;
    }
}

/* Standard Desktops & Laptops (1366px - 1599px) - 4 colonnes */
@media (max-width: 1599px) and (min-width: 1366px) {
    :root {
        --films-per-row: 4;
        --film-gap: 40px;
    }
    
    header {
        padding: 0 30px;
    }
    
    .film-une-box {
        padding: 25px 40px;
        max-width: 500px;
    }
    
    .film-une-title {
        font-size: 40px;
    }
    
    .film-une-description {
        font-size: 18px;
    }
}

/* Small Laptops (1280px - 1365px) - 3 colonnes */
@media (max-width: 1365px) and (min-width: 1280px) {
    :root {
        --films-per-row: 3;
        --film-gap: 40px;
        --film-card-width: 240px;
    }
    
    header {
        padding: 0 25px;
    }
    
    .header-nav {
        gap: 30px;
        max-width: 500px;
    }
    
    .film-une-box {
        padding: 20px 35px;
        max-width: 450px;
        left: 30px;
    }
    
    .film-une-title {
        font-size: 36px;
    }
    
    .film-une-description {
        font-size: 16px;
    }
    
    .categorie-title {
        font-size: 26px;
    }
}

/* Very Small Laptops (1024px - 1279px) - 3 colonnes */
@media (max-width: 1279px) and (min-width: 1024px) {
    :root {
        --films-per-row: 3;
        --film-gap: 35px;
        --film-card-width: 220px;
    }
    
    header {
        padding: 0 20px;
        height: 75px;
    }
    
    .header-nav {
        gap: 25px;
        max-width: 450px;
    }
    
    .link {
        font-size: 14px;
    }
    
    .search {
        width: 240px;
    }
    
    .film-une-box {
        padding: 20px 30px;
        max-width: 400px;
        left: 25px;
    }
    
    .film-une-title {
        font-size: 32px;
    }
    
    .film-une-description {
        font-size: 15px;
    }
    
    .categorie-title {
        font-size: 24px;
    }
    
    .film-card {
        height: 250px;
    }
}

/* Tablets (768px - 1023px) - 2 colonnes */
@media (max-width: 1023px) and (min-width: 768px) {
    :root {
        --films-per-row: 2;
        --film-gap: 30px;
        --film-card-width: 220px;
    }
    
    header {
        padding: 0 20px;
        height: 70px;
        /* keep header as a single row to avoid pushing nav to a second line */
        flex-wrap: nowrap;
    }

    .header-nav {
        gap: 20px;
        max-width: 100%;
        /* don't force nav to full width (prevents it from breaking into a new row)
           allow horizontal scroll if items overflow on small screens */
        justify-content: center;
        margin-top: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .header-search-group {
        gap: 8px;
        margin-right: 0;
    }
    
    .filter-button {
        padding: 8px 12px;
        height: 40px;
        min-width: 40px;
    }
    
    .filter-icon {
        width: 18px;
        height: 18px;
    }
    
    .link {
        font-size: 12px;
    }
    
    .search {
        width: 200px;
    }
    
    .film-une-box {
        padding: 15px 25px;
        max-width: 350px;
        left: 20px;
    }
    
    .film-une-title {
        font-size: 28px;
    }
    
    .film-une-description {
        font-size: 14px;
    }
    
    .categorie-title {
        font-size: 22px;
    }
    
    .film-card {
        height: 250px;
    }
}

/* Mobile (moins de 768px) - 1 colonne */
@media (max-width: 767px) {
    :root {
        --films-per-row: 1;
        --film-gap: 25px;
        --film-card-width: 280px;
    }
    
    header {
        padding: 0 15px;
        height: auto;
        /* keep header layout stable; nav will handle overflow instead of wrapping */
        flex-direction: row;
        align-items: center;
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .header-nav {
        gap: 15px;
        /* prevent nav items from wrapping to multiple rows */
        flex-wrap: nowrap;
        justify-content: center;
        margin-top: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .header-search-group {
        margin: 15px 0 0 0;
        gap: 8px;
    }
    
    .header-button {
        width: 120px;
    }
    
    .link {
        font-size: 10px;
    }
    
    .search {
        width: 100%;
        max-width: 300px;
    }
    
    /* Filter popup responsive */
    .filter-popup-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .filter-popup-header {
        padding: 20px;
    }
    
    .filter-popup-header h2 {
        font-size: 20px;
    }
    
    .filter-popup-close {
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    
    .filter-popup-body {
        padding: 20px;
    }
    
    .filter-group {
        margin-bottom: 25px;
    }
    
    .filter-label {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .filter-options {
        gap: 10px;
    }
    
    .filter-checkbox {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .filter-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    .filter-range {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-range span {
        display: none;
    }
    
    .filter-input {
        width: 100%;
        padding: 10px 14px;
    }
    
    .filter-popup-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .filter-popup-footer .button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .films-une-container {
        margin-top: 20px;
    }
    
    .film-une-box {
        position: static;
        transform: none;
        margin-top: 15px;
        padding: 15px 20px;
        max-width: 100%;
    }
    
    .film-une-title {
        font-size: 24px;
    }
    
    .film-une-description {
        font-size: 13px;
    }
    
    .categorie-title {
        font-size: 20px;
        padding-left: 15px;
    }
    
    .film-card {
        height: 320px;
    }
    
    .film-card-hover {
        width: 280px;
    }
}

/* --- Catégorie & Tags under hero image --- */
.category-section {
    /* match the main content width and center */
    width: calc((var(--film-card-width) * var(--films-per-row)) + (var(--film-gap) * (var(--films-per-row) - 1)));
    max-width: 95vw;
    margin: 25px auto 0 auto; /* 25px below the main image */
    box-sizing: border-box;
    padding: 0 20px;
}

.category-heading {
    color: #FFFFFF;
    font-size: 30px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap; /* toujours sur une ligne */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Notation section styling */
.notation-section {
    width: calc((var(--film-card-width) * var(--films-per-row)) + (var(--film-gap) * (var(--films-per-row) - 1)));
    max-width: 95vw;
    margin: 20px auto 0 auto;
    box-sizing: border-box;
    padding: 0 20px;
}

.notation-row {
    display: flex;
    align-items: center;
    margin-top: 20px; /* 20px sous le titre de la catégorie */
}

.notation-label {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 18px;
}

.notation-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 10px;
    color: var(--white-100);
    background: transparent;
    border: 2px solid var(--main-color);
    font-weight: 700;
    font-size: 14px;
    box-sizing: border-box;
    height: 40px;
    min-width: 140px;
    margin-left: 15px; /* 15px à droite du bord droit du texte */
}

.tag-list {
    display: flex;
    gap: 10px; /* séparation de 10px */
    flex-wrap: wrap; /* sur plusieurs lignes si besoin */
    margin-top: 10px; /* 10px en dessous du titre */
    align-items: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 10px;
    color: var(--white-100);
    background: transparent;
    border: 2px solid var(--main-color); /* contour rouge */
    font-weight: 700;
    font-size: 14px;
    box-sizing: border-box;
    height: 40px; /* same height as .button */
    min-width: 140px; /* match .button width */
}

.tag-public {
    /* reuse stroke look but ensure consistent sizing */
    padding: 6px 14px;
    border: 2px solid var(--white-10);
    background: transparent;
}
/* Comments section styling */
.comments-section {
    width: calc((var(--film-card-width) * var(--films-per-row)) + (var(--film-gap) * (var(--films-per-row) - 1)));
    max-width: 95vw;
    margin: 30px auto 80px auto;
    padding: 0 20px 0 20px;
    box-sizing: border-box;
}

.comments-row {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.comment-box {
    flex: 1;
    background: #141414;
    border: 4px solid var(--main-color);
    border-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
}

.comment-author {
    color: var(--white-100);
    font-size: 16px;
    font-weight: 700;
}

.comment-rating-row {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.comment-rating-label {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 18px;
}

.comment-rating-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 10px;
    color: var(--white-100);
    background: transparent;
    border: 2px solid var(--main-color);
    font-weight: 700;
    font-size: 14px;
    box-sizing: border-box;
    height: 40px;
    min-width: 140px;
    margin-left: 15px;
}

.comment-description {
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    font-weight: bold;
    margin: 10px 0 0 0;
    line-height: 1.4;
    width: calc(100% - 40px);
}

/* ==============================
   VIDEO PAGE & PLAYER STYLING
   ============================== */

/* Page wrapper for video content */
.video-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 30px 20px 80px 20px;
    box-sizing: border-box;
}

/* Video header: title, tags and audience */
.video-header {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 18px;
    box-sizing: border-box;
}

.video-title {
    color: var(--white-100);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 36px 0; /* espace augmenté entre le titre et les tags */
}

.video-meta-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.video-tags { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; /* espace augmenté entre tags et video */ }
.video-public { margin-left: 6px; }

/* Style tags to match the filled buttons (button-fill) */
.video-tags .tag {
    background-color: var(--main-color);
    color: var(--white-100);
    border: 0; /* filled look */
    padding: 8px 16px;
    min-width: auto;
    height: 40px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    box-sizing: border-box;
}

.video-tags .tag:hover {
    background-color: #ff5555;
    box-shadow: 0 6px 20px rgba(232,69,69,0.18);
    transform: translateY(-2px);
}

/* keep the public tag as stroke variant if present elsewhere */
.video-public .tag-public {
    padding: 6px 10px;
    border: 2px solid var(--white-10);
    background: transparent;
}

@media (max-width: 767px) {
    .video-title { font-size: 20px; margin-bottom: 20px; }
    .video-meta-row { gap: 8px; }
    .video-tags { margin-bottom: 12px; }
}

.video-player {
    width: 100%;
    max-width: 1200px;
    position: relative;
    background: #000; /* fallback while poster loads */
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 6px 18px rgba(232,69,69,0.06);
    border: 1px solid rgba(255,255,255,0.04);
}

/* Base video element styling */
.video-player .player {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    background-color: #000;
    outline: none;
}

/* Custom visual overlay play button (non-functional without JS) */
.video-overlay-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 96px;
    border: 0;
    background: transparent; /* remove circular background so only the logo shows */
    box-shadow: none;
    cursor: pointer;
    opacity: 1;
}

.video-overlay-play::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    /* use VODeefy logo as the play icon */
    width: 56%;
    height: 56%;
    background-image: url('img/logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}

/* Small translucent control hint at bottom of player for duration/seek etc. (visual only) */
.video-player::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.38) 100%);
    pointer-events: none;
}

.video-meta {
    width: 100%;
    max-width: 1200px;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255,255,255,0.9);
}

.video-duration {
    color: var(--white-40);
    font-weight: 700;
}

/* Captions styling (WebVTT cues) */
video::cue {
    background: rgba(0,0,0,0.6);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .video-overlay-play { width: 80px; height: 80px; }
    .video-overlay-play::before { width: 60%; height: 60%; background-size: contain; }
}

@media (max-width: 767px) {
    .video-page { padding: 18px 12px 60px 12px; }
    .video-player { border-radius: 10px; }
    .video-overlay-play { width: 64px; height: 64px; }
    .video-overlay-play::before { width: 56%; height: 56%; background-size: contain; }
    .video-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Accessibility: hide overlay play if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .video-overlay-play { display: none; }
}

/* ===== Generic card & form styles used by admin and other pages ===== */
.card {
    background: #141414;
    border: 1px solid var(--white-04);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.form-group { margin-bottom: 14px; display: flex; flex-direction: column; }
.form-group label { color: var(--white-100); font-weight: 700; margin-bottom: 6px; }
.form-control { background: var(--white-04); border: 1px solid var(--white-10); color: var(--white-100); padding: 10px 12px; border-radius: 8px; box-sizing: border-box; }
.form-control[type="file"] { padding: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--main-color); color: var(--white-100); border: 0; }
.btn-primary:hover { background: #ff5555; }
.btn-secondary { background: transparent; color: var(--white-100); border: 2px solid var(--white-10); }
.btn-secondary:hover { background: var(--white-04); }

/* Catalogue grid helper (used by AdminRenderer) */
.catalogue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.serie-card { background: var(--white-04); border-radius: 10px; height: 160px; position: relative; overflow: hidden; }
.serie-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--white-100); background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.6)); }

/* Error message consistent style */
.error-message { color: #ff6b6b; border: 1px solid rgba(255,107,107,0.18); background: rgba(255,107,107,0.04); padding: 12px; border-radius: 8px; margin: 10px 0; }
