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

/* Ajustement du body pour compenser le header fixe */
body {
    background-color: #0a0e17;
    color: #fff;
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
    padding-top: 90px; /* Compense la hauteur du header fixe */
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e17;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeOut 1s ease 2s forwards;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* Header optimisé responsive */
header {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(to bottom, #0f1620, rgba(15, 22, 32, 0.95));
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: 70px;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Menu hamburger moderne */
.menu-toggle {
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid rgba(52, 152, 219, 0.3);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    position: relative;
    overflow: hidden;
    min-width: 80px;
}

.menu-toggle:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.menu-toggle.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #3498db;
}

.hamburger {
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

.menu-text {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.3rem;
}

/* Menu déroulant avec animation */
.menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 22, 32, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-top: none;
}

.menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Réorganisation du contenu dans le menu */
.menu-dropdown .search-container {
    display: block; /* Affiché dans le menu */
    position: static;
    width: calc(100% - 6rem);
    max-width: none;
    margin: 1.5rem;
    margin-bottom: 1rem;
}

.menu-dropdown .category-filter {
    display: flex; /* Affiché dans le menu */
    margin: 0 1.5rem 1.5rem;
    justify-content: flex-start;
}

/* Conteneur search responsive dans le menu */
.menu-dropdown #searchInput {
    width: 100%;
    max-width: 300px;
    padding: 12px 40px 12px 18px;
    font-size: 15px;
    border-radius: 25px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(57, 8, 112, 0.3);
    outline: none;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ff6600" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px 18px;
}

.menu-dropdown #searchInput:focus {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
    background-color: #fff;
}

.menu-dropdown #searchInput::placeholder {
    color: #0e2544;
    font-weight: 500;
}

.logo {
    font-size: clamp(1.5rem, 4vw, 2rem);
    background: linear-gradient(90deg, #3498db, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    flex-shrink: 0;
}

/* Navigation responsive - maintenant dans le menu */
.nav-links {
    display: none; /* Masqué car remplacé par le menu hamburger */
}

/* Conteneur search responsive - maintenant dans le menu */
.search-container {
    display: none; /* Masqué de la position originale */
}

/* Styles pour la recherche dans le menu déroulant */
.menu-dropdown .search-container {
    display: block; /* Affiché dans le menu */
    position: static;
    width: calc(100% - 3rem);
    max-width: none;
    margin: 1.5rem;
    margin-bottom: 1rem;
}

.menu-dropdown #searchInput {
    width: 100%;
    max-width: 300px;
    padding: 12px 40px 12px 18px;
    font-size: 15px;
    border-radius: 25px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(57, 8, 112, 0.3);
    outline: none;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23ff6600" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px 18px;
}

.menu-dropdown #searchInput:focus {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
    background-color: #fff;
}

.menu-dropdown #searchInput::placeholder {
    color: #0e2544;
    font-weight: 500;
}

/* Filtres de catégorie responsive - maintenant dans le menu */
.category-filter {
    display: none; /* Masqué de la position originale */
}

/* Conteneur de films optimisé mobile */
.film-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem;
    max-width: 100%;
}

/* Cartes de film optimisées */
.film-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.film-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.film-card a {
    text-decoration: none;
    color: white;
    display: block;
}

.film-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.film-card:hover .film-overlay {
    opacity: 1;
}

.play-btn {
    width: 50px;
    height: 50px;
    background: rgba(52, 152, 219, 0.8);
    border-radius: 50%;
    position: relative;
}

.play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-left: 15px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.film-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    vertical-align: bottom;
    transition: transform 0.3s ease;
}

.film-card:hover .film-poster {
    transform: scale(1.05);
}

.film-info {
    padding: 0.8rem;
    background: linear-gradient(to top, #0a0e17, transparent);
}

.film-title {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.film-year, .film-rating {
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    color: #ccc;
    margin-right: 0.8rem;
}

.film-genre {
    display: inline-block;
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: clamp(0.6rem, 1.8vw, 0.7rem);
    margin-top: 0.4rem;
}

/* Titres avec effets */
.cinextitle {
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: white;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    position: relative;
    margin: 1rem 0;
}

.hd-streaming {
    font-size: clamp(0.8rem, 2.5vw, 1rem);
    margin-left: 10px;
    font-weight: bold;
    background: linear-gradient(90deg, #ff4d00, #ffcc00, #ff4d00);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.4);
}

.flame {
    display: inline-block;
    margin-left: 10px;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    animation: flicker 0.3s infinite alternate;
    filter: drop-shadow(0 0 6px orange) drop-shadow(0 0 8px red);
}

@keyframes flicker {
    0% { transform: rotate(0deg) scale(1); opacity: 0.95; }
    50% { transform: rotate(-2deg) scale(1.1); opacity: 0.7; }
    100% { transform: rotate(2deg) scale(1.05); opacity: 1; }
}

/* Ligne décorative */
.glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
    margin: 2rem 0;
    position: relative;
}

.glow-line::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    box-shadow: 0 0 15px 5px rgba(52, 152, 219, 0.7);
}

/* Footer responsive */
footer {
    background: linear-gradient(to top, #0f1620, transparent);
    padding: 2rem 1rem 1rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.footer-logo {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    background: linear-gradient(90deg, #3498db, #9b59b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.footer-links a:hover {
    color: #3498db;
}

.copyright {
    color: #666;
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    margin-top: 1rem;
}

/* Bouton retour en haut */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 35px;
    height: 35px;
    background: rgba(52, 152, 219, 0.8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 2px solid white;
    border-left: 2px solid white;
    transform: rotate(45deg) translate(2px, 2px);
}

:target .back-to-top {
    opacity: 1;
    visibility: visible;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.film-card {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Styles pour les filtres dans le menu déroulant */
.menu-dropdown .category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
    margin: 0 1.5rem 1.5rem;
}

.menu-dropdown .filter-btn {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    white-space: nowrap;
}

.menu-dropdown .filter-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.menu-dropdown .filter-btn.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
}

@media (min-width: 1024px) {
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 2rem;
    }
    
    .film-card {
        max-width: 240px;
    }
}
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.2rem;
        padding: 1.5rem;
    }
    
    header {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
}

@media (min-width: 768px) {
    header {
        padding: 1.5rem;
        min-height: 80px;
    }
    
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
        padding: 2rem;
    }
    
    .film-card {
        max-width: 220px;
    }
    
    .menu-toggle {
        padding: 0.6rem 1rem;
        min-width: 70px;
    }
    
    .hamburger {
        width: 16px;
    }
    
    .menu-text {
        font-size: 0.75rem;
    }
}

/* Styles pour les filtres dans le menu déroulant */
.menu-dropdown .category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
    margin: 0 1.5rem 1.5rem;
}

.menu-dropdown .filter-btn {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    white-space: nowrap;
}

.menu-dropdown .filter-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.menu-dropdown .filter-btn.active {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
}

@media (min-width: 1200px) {
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .film-card {
        max-width: 260px;
    }
}

/* Optimisations pour très petits écrans */
@media (max-width: 360px) {
    body {
        padding-top: 80px;
    }
    
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .film-info {
        padding: 0.6rem;
    }
    
    header {
        padding: 0.8rem;
        min-height: 60px;
    }
    
    .menu-toggle {
        padding: 0.5rem 0.8rem;
        border-radius: 15px;
        min-width: 60px;
    }
    
    .hamburger {
        width: 14px;
        height: 1.5px;
    }
    
    .menu-text {
        font-size: 0.7rem;
        margin-top: 0.2rem;
    }
    
    .menu-dropdown .search-container {
        margin: 1rem;
    }
    
    .menu-dropdown .category-filter {
        margin: 0 1rem 1rem;
        gap: 0.3rem;
    }
    
    .menu-dropdown .filter-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
} {
        width: 240px;
        top: 20px;
    }
    
    #searchInput {
        font-size: 15px;
    }
    
    .film-card {
        max-width: 220px;
    }
}

@media (min-width: 1024px) {
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 2rem;
    }
    
    .search-container {
        width: 260px;
        top: 25px;
    }
    
    #searchInput {
        font-size: 16px;
    }
    
    .film-card {
        max-width: 240px;
    }
}

@media (min-width: 1200px) {
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .film-card {
        max-width: 260px;
    }
}

/* Optimisations pour très petits écrans */
@media (max-width: 360px) {
    .film-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .film-info {
        padding: 0.6rem;
    }
    
    header {
        padding: 0.8rem;
        min-height: 60px;
    }
    
    .category-filter {
        margin: 1rem 0;
        gap: 0.3rem;
    }
    
    .filter-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
}