/* Section profil : deux colonnes */
#profile-section .profile-flex {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-top: 40px;
    width: 90vw;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}
.profile-info-list {
    list-style: none;
    padding: 0;
    margin: 0.5em 0;
}
#profile-section .profile-infos {
    flex: 0 0 350px;
    background: #23234a;
    border-radius: 18px;
    padding: 2.5rem 2rem;
    font-size: 1.2em;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

#profile-section .profile-reservations {
    flex: 1 1 400px;
    min-width: 220px;
    max-width: 600px;
    background: #23234a;
    border-radius: 18px;
    padding: 2.5rem 2rem;
    font-size: 1.2em;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

/* Base styling for the profile section (centralized - replaces inline styles in accueil.php) */
#profile-section,
.profile-section {
    display: none; /* hidden by default; JS will toggle via style.display */
    height: 100%;
    background: #181830;
    color: #fff;
    padding: 2rem;
    border-radius: 16px;
    max-width: 1600px;
    margin: 40px auto;
}

/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121223;
    color: white;
    line-height: 1.6;
}

header {
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 40px; /* Augmente l'espace sur les côtés */
}

.logo {
    flex: 1;
    display: flex;
    justify-content: flex-start; /* Logo à gauche */
}

.logo img {
    height: 140px; /* Un peu plus grand si tu veux */
    margin-left: 100px; /* Décale le logo vers la droite */
}

nav {
    flex: 1;
    display: flex;
    justify-content: flex-end; /* Nav à droite */
    margin-right: 200px;
}

nav .btn {
    background-color: #ffc107;
    color: black;
    border: none;
    padding: 16px 36px; /* Plus gros boutons */
    margin-left: 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

nav .btn:hover {
    background-color: #00A3FF;
}

/* Featured movies section */

.featured-movies {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0e0e1b;
    min-height: 400px;
    position: relative;
    padding: 10px 0;
}

.carousel-slide {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 900px;
    max-width: 95vw;
    gap: 40px;
}

.carousel-slide img {
    margin-left: 40px;
    width: 400px;
    height: 500px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.carousel-caption {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 32px 32px;
    border-radius: 16px;
    width: 380px;
    height: 500px;
    margin-top: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-caption h3 {
    margin-bottom: 18px;
    font-size: 2em;
}

.carousel-caption p {
    font-size: 1.15em;
}

.carousel-btn {
    background: rgba(0,0,0,0.5);
    color: #ffc107;
    border: none;
    font-size: 2.5em;
    padding: 0 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 2;
}

.carousel-btn:hover {
    background: #00A3FF;
    color: #0e0e1b;
}

/* Reserve button */
.reserve-button {
    text-align: center;
    margin: 20px 0;
}

.reserve-button .btn {
    background-color: #ffc107;
    color: black;
    border: none;
    padding: 16px 36px; /* Plus gros boutons */
    margin-left: 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s;
}

.reserve-button .btn:hover {
    background-color: #00A3FF;
}

/* Features section */
.features {
    text-align: center;
    padding: 40px 20px;
}

.features h2 {
    margin-bottom: 20px;
    font-size: 40px;
    color: #ffffff;
    text-align: center;
}

.feature-list {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 100px;        
    margin-top: 20px;
}

.feature-list div {
    width: 400px;
    font-size: 16px;
    margin-top: 50px;
    text-align: center;
    font-size: 20px;
}

/* Services section */
.services {
    text-align: center;
    padding: 40px 20px;
}

.services h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #ffffff;
}

.service-cards {
    display: flex;
    justify-content: center;      
    align-items: center;          
    flex-wrap: wrap;
    gap: 200px;                    
    margin-top: 30px;
}

.card {
    background-color: #a00000;
    padding: 20px;
    width: 260px;
    height: 250px;
    margin: 10px;
    border-radius: 10px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.card .btn {
    background-color: #ffc107;
    color: black;
    border: none;
    margin-top: 45px;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.card .btn:hover {
    background-color: #00A3FF;
}

/* Footer */
footer {
    background-color: black;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    margin-top: 40px;
    font-size: 14px;
}

.footer-left,
.footer-center,
.footer-right {
    display: inline-block;
    vertical-align: middle;
}

.footer-left {
    margin-left: 280px;
}
.footer-right {
    margin-right: 150px;
}
.footer-right img {
    height: 120px;
}

/* Boutons génériques */
.btn {
    background-color: #ffc107;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #00A3FF;
}

/* Reservation list items inside profile */
.reservation-list {
    list-style: none;
    padding: 0;
}
.reservation-item {
    margin-bottom: 1.5em;
    border-bottom: 1px solid #333;
    padding-bottom: 1em;
    position: relative;
}

/* Danger / cancel button */
.btn-danger {
    margin-top: 10px;
    background: #e53935;
    color: #fff;
}
.btn-danger:hover { background: #d32f2f; }


.force-hide {
    display: none !important;
}

/* Responsive rules - mobile-first overrides */
@media (max-width: 1024px) {
    header { padding: 12px 20px; }
    .logo img { height: 100px; margin-left: 20px; }
    nav { margin-right: 40px; }
}

@media (max-width: 768px) {
    /* Stack header elements */
    header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
    }
    .logo { order: 1; }
    .logo img { height: 80px; margin-left: 0; }
    nav { order: 2; margin-right: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
    nav .btn { padding: 10px 14px; margin-left: 8px; font-size: 1em; }

    /* Carousel: column layout for small screens */
    .featured-movies { padding: 10px 8px; }
    .carousel-slide { flex-direction: column; align-items: center; width: 95vw; gap: 16px; }
    .carousel-slide img { width: 90%; height: auto; max-width: 360px; margin-left: 0; }
    .carousel-caption { width: 90%; height: auto; padding: 18px; border-radius: 12px; }
    .carousel-caption h3 { font-size: 1.4em; }
    .carousel-caption p { font-size: 1em; }
    .carousel-btn { font-size: 2em; padding: 6px 12px; }

    /* Features and services -> single column */
    .feature-list { gap: 20px; }
    .feature-list div { width: 100%; }
    .service-cards { gap: 16px; }
    .card { width: 100%; max-width: 520px; }

    /* Footer stacking */
    footer { flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 20px; }
    .footer-left, .footer-center, .footer-right { margin: 0; }
    .footer-right img { height: 60px; }

    /* Profile section stack */
    #profile-section .profile-flex { flex-direction: column; align-items: center; width: 95vw; }
    #profile-section .profile-infos, #profile-section .profile-reservations { flex: 1 1 100%; max-width: 720px; }

    /* Make forms and inputs full width on small screens (override inline widths) */
    form, #reservation-form, #custom-video-form, #inscription-form, #connexion-form {
        width: 100%;
        padding: 1rem;
    }
    form label { display: block !important; width: 100% !important; margin-bottom: 6px; }
    form input, form select, form textarea { width: 100% !important; max-width: 100% !important; }

    /* Modals: make them fluid */
    .modal > div { min-width: 0 !important; width: 92vw !important; max-width: 520px !important; padding: 1.25rem !important; }
}

@media (max-width: 480px) {
    .logo img { height: 64px; }
    nav .btn { padding: 8px 10px; font-size: 0.95em; }
    .carousel-caption h3 { font-size: 1.2em; }
    .carousel-caption p { font-size: 0.95em; }
    .card { padding: 14px; }
    header { padding: 10px 10px; }
    .reserve-button .btn, .btn { padding: 10px 12px; }
}

/* Specific tweaks for profile section and dynamically created film-details modal */
@media (max-width: 768px) {
    /* Many profile usages use inline container divs; target the section root and common child patterns */
    #profile-section { padding: 1rem; }
    #profile-section > div, #profile-section .profile-flex {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
        width: 85vw !important;
        max-width: 720px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    /* Make profile info and reservations full width */
    #profile-section .profile-infos, #profile-section .profile-reservations,
    #profile-infos, /* fallback id used in inline markup */
    .profile-infos, .profile-reservations {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 1.25rem !important;
    }
    /* Ensure any avatar / images inside profile scale */
    #profile-section img, .profile-infos img { max-width: 160px; width: 40%; height: auto; margin: 0 auto 8px; display: block; }

    /* Film details modal (created dynamically in movie.js) */
    #film-details-modal { z-index: 9999; }
    #film-details-modal > div {
        width: 92vw !important;
        max-width: 640px !important;
        height: auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 1rem !important;
        box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    }
    /* The inner content uses a flex row with a gap; switch to column on mobile */
    #film-details-modal > div > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        align-items: center !important;
    }
    #film-modal-img { width: 90% !important; max-width: 320px !important; height: auto !important; margin: 0 !important; }
    #film-details-modal h3, #film-details-modal p, #film-details-modal #film-modal-duration { text-align: center; }
    /* Make action buttons full width and easier to tap */
    #film-details-modal .btn { width: 100% !important; padding: 12px 14px !important; }
    /* Reduce font sizes a bit on narrow screens to avoid overflow */
    #film-details-modal h3 { font-size: 1.15rem; margin-bottom: 6px; }
    #film-details-modal p { font-size: 0.98rem; color: #ddd; }
}

@media (max-width: 480px) {
    /* Extra tight mobile adjustments */
    #film-details-modal > div { padding: 0.75rem !important; }
    #film-modal-img { max-width: 280px !important; }
    #profile-section img { max-width: 120px; }
}



