/* ==========================================================================
   1. STYLE GLOBAL & RESPONSIVE BASE - THÈME 100% NETFLIX
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #141414; /* Le noir pur Netflix */
    color: #ffffff;
    -webkit-text-size-adjust: 100%;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

body.is-loaded {
    opacity: 1;
    transform: translateY(0);
}

a {
    color: #E50914; /* Rouge Netflix */
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
}

a:hover {
    color: #b80710;
}

/* Barre de navigation responsive style Netflix */
navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.85) 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    height: 64px;
    overflow: visible;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.6);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#siteNavbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100000 !important;
    height: 64px;
    padding-top: env(safe-area-inset-top, 0);
}

.logo {
    color: #E50914;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: #e5e5e5;
    flex-wrap: wrap;
}

.user-menu span strong {
    color: #e50914;
}

.logout-btn, .btn, .request-18-btn, .btn-login {
    color: #ffffff;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.logout-btn, .btn-login { background-color: #E50914; padding: 7px 15px; font-size: 0.85rem; }
.request-18-btn { background-color: #6f42c1; padding: 6px 12px; font-size: 13px; font-weight: bold; }

.logout-btn:hover, .btn-login:hover { background-color: #b80710; }
.request-18-btn:hover { background-color: #5a32a3; }

.logout-btn:active, .btn:active, .request-18-btn:active, .toggle-eye-btn:active, .nav-btn:active, .btn-login:active {
    transform: scale(0.96);
}

.badge-requested-18, .badge-granted-18 {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    animation: badgeAppear 0.5s ease;
}
.badge-requested-18 { background-color: #ffc107; color: black; }
.badge-granted-18 { background-color: #28a745; color: white; }

@keyframes badgeAppear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.admin-link { font-size: 0.9rem; font-weight: bold; }

/* Conteneur Plein Écran */
.container, .watch-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 3%;
    box-sizing: border-box;
    --navbar-height: 64px;
    padding-top: calc(var(--navbar-height) + 20px);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

body.is-loaded .container, body.is-loaded .watch-container {
    opacity: 1;
}

/* ==========================================================================
   2. PAGES DE CONNEXION & INSCRIPTION
   ========================================================================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), #141414;
}

.login-box {
    background-color: rgba(0, 0, 0, 0.85);
    padding: 40px 30px;
    border-radius: 6px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    animation: boxEntry 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes boxEntry {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.login-box h2 {
    text-align: left;
    margin-bottom: 24px;
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: bold;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #8c8c8c;
    font-size: 0.85rem;
}

.input-group input {
    width: 100%;
    padding: 14px;
    background-color: #333333;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.input-group input:focus {
    background-color: #454545;
    border-color: #555;
}

.input-group input:focus + label::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #e50914;
    margin-left: 8px;
    animation: pulseLabel 1s ease-in-out infinite;
}

@keyframes pulseLabel {
    0% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(229, 9, 20, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0); }
}

.error-msg {
    color: #ffffff;
    background-color: #e87c03;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

/* ==========================================================================
   3. PAGE CATALOGUE (movies.php) - CARROUSELS
   ========================================================================= */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    gap: 10px;
}

.main-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: #fff;
}

.genre-buttons-header {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 16px;
    flex-wrap: wrap;
}

.genre-toggle {
    background: transparent;
    color: #ddd;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.genre-toggle:hover { color: #fff; background: rgba(255,255,255,0.04); }
.genre-toggle.active { text-decoration: underline; background: rgba(255,255,255,0.08); }

.toggle-eye-btn {
    background: #222;
    border: 1px solid #444;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 20px;
    color: white;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toggle-eye-btn:hover { background: #333; border-color: #666; }

.section-title {
    color: #E50914;
    margin: 35px 0 15px 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-adult-title { color: #ef4444; }
.empty-msg { color: #777; font-style: italic; padding: 10px 0; }

/* Carrousel */
.slider-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    padding: 0 50px;
}

.movies-slider {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    width: 100%;
    scrollbar-width: none;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    cursor: grab;
}

.movies-slider:active {
    cursor: grabbing;
}

.movies-slider::-webkit-scrollbar {
    display: none;
}

.slider-wrapper:hover .slider-arrow { opacity: 1; }

.slider-arrow {
    position: absolute;
    top: calc(50% - 25px);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.1s;
    opacity: 0.8;
    box-sizing: border-box;
    padding: 0;
}

.slider-arrow:hover { background: rgba(0, 0, 0, 0.95); }
.slider-arrow:active { background: rgba(229, 9, 20, 0.9) !important; transform: scale(0.95); }
.slider-arrow.left { left: 0px; }
.slider-arrow.right { right: 0px; }

/* Cartes de films */
.movie-card {
    flex: 0 0 210px;
    width: 210px;
    min-width: 210px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-color: #181818;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 1;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease, opacity 0.3s ease;
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.movie-info {
    padding: 10px;
    text-align: center;
}

.movie-title {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.movie-category {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* Barre de progression pour l'historique de lecture */
.progress-container, .history-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
}

.progress-fill, .history-progress-fill {
    height: 100%;
    background: #e50914;
    width: 0%;
}

.movie-card:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
    z-index: 2;
}

.movie-card.hidden {
    display: none !important;
}

.hide-18 .is-18-item {
    opacity: 0 !important;
    transform: scale(0.92) translateY(5px) !important;
    width: 0 !important;
    min-width: 0 !important;
    flex: 0 0 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.hide-18 .movie-18-wrapper,
.hide-18 .porn-section {
    opacity: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, max-height 0.4s ease, transform 0.3s ease;
}

.hide-18 .adult-link {
    opacity: 0 !important;
    transform: translateY(-4px) scale(0.98) !important;
    pointer-events: none !important;
    transition: opacity 220ms ease, transform 220ms ease;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .container, .watch-container {
        padding: 15px 2%;
        padding-top: calc(var(--navbar-height) + 15px);
    }

    .slider-wrapper {
        padding: 0 32px;
    }

    .slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
        top: calc(50% - 16px);
        opacity: 0.9;
    }

    .movie-card {
        flex: 0 0 135px;
        width: 135px;
        min-width: 135px;
    }

    .movie-title {
        font-size: 12px;
    }

    .movie-category {
        font-size: 10px;
    }
}