:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --secondary: #06b6d4;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;

    --background: #0f172a;
    --background-secondary: #1e293b;
    --card-bg: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.8);

    --border: #334155;
    --border-light: #475569;

    --shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.4);

    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #1a202c 100%);
    color: var(--text);
    line-height: 1.6;
    padding-top: 80px;
    overflow-x: hidden;
}

.navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.logo-container {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.logo-text {
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
}

.brand-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.navbar-toggler {
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary) !important;
    background: var(--glass-bg);
}

.theme-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: rotate(180deg) scale(1.1);
}

.movie-hero-section {
    height: 100vh;
    min-height: 700px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin: 2rem 1rem;
    box-shadow: var(--shadow-lg);
}

.movie-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.movie-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 4rem 0;
    z-index: 2;
}

.hero-content-wrapper {
    max-width: 800px;
}

.movie-title {
    font-family: "Playfair Display", serif;
    font-size: 4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.movie-overview {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.6;
    max-width: 700px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-action {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    transition: var(--transition);
    border: none;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn-action .btn-text {
    white-space: nowrap;
}

.poster-container {
    display: flex;
    justify-content: center;
    align-items: end;
    height: 100%;
    padding-bottom: 4rem;
}

.movie-poster {
    max-width: 350px;
    width: 100%;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.movie-poster:hover {
    transform: scale(1.05);
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.rating-label {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.star-rating {
    display: flex;
    gap: 0.5rem;
    cursor: pointer;
}

.star-rating .star {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    cursor: pointer;
}

.star-rating .star:hover,
.star-rating .star.filled {
    color: var(--warning);
    transform: scale(1.1);
}

.star-rating .star:hover ~ .star {
    color: rgba(255, 255, 255, 0.3);
}

.star-rating.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.star-rating.disabled .star {
    pointer-events: none;
}

.content-section {
    margin: 4rem 1rem;
}

.section-title {
    font-family: "Playfair Display", serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.title-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 70px;
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.cast-carousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--background-secondary);
}

.cast-carousel::-webkit-scrollbar {
    height: 8px;
}

.cast-carousel::-webkit-scrollbar-track {
    background: var(--background-secondary);
    border-radius: 4px;
}

.cast-carousel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

.cast-member {
    flex: none;
    width: 150px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.cast-member:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.cast-member img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--border);
}

.cast-member h6 {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cast-member small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.distributors-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.distributor-badge {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.distributor-badge:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.production-companies {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.production-company {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
}

.production-company:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

.providers-container {
    display: grid;
    gap: 2rem;
}

.provider-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: var(--transition);
}

.provider-section:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.provider-section h3 {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.provider-section h3 i {
    color: var(--primary);
}

.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.provider-card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.provider-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.provider-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin: 0 auto 0.5rem;
    border-radius: 8px;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.provider-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.provider-type {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}
/* Dans movie-details.css */
.vod-providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.vod-provider-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
}

.vod-provider-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.vod-provider-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    background: white;
    padding: 4px;
    border-radius: 8px;
}

.vod-provider-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.25rem;
}

.vod-provider-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}
.trailer-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
}

.trailer-container iframe {
    width: 100%;
    height: 500px;
    border-radius: var(--border-radius);
    border: none;
}

.no-trailer {
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 3rem;
}

.toast-container {
    z-index: 1050;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    color: var(--text);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.toast-body {
    padding: 1rem;
    font-weight: 500;
}

.footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

[data-theme="light"] {
    --text: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    --background: #f9fafb;
    --background-secondary: #ffffff;
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.8);

    --border: #e5e7eb;
    --border-light: #d1d5db;
}

[data-theme="light"] body {
    background: linear-gradient(135deg, var(--background) 0%, #f3f4f6 100%);
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95) !important;
}

[data-theme="light"] .provider-logo {
    background: rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 992px) {
    .movie-title {
        font-size: 3rem;
    }

    .movie-overview {
        font-size: 1.1rem;
    }

    /* Styles de base des boutons */
    .btn-action {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 25px;
        transition: var(--transition);
        border: none;
        min-width: 200px; /* Largeur de base */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        flex: 1; /* Permet aux boutons de s'adapter */
    }

    /* Conteneur des boutons */
    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    /* Adaptations pour tablettes */
    @media (max-width: 992px) {
        .btn-action {
            min-width: 180px;
            padding: 0.9rem 1.25rem;
            font-size: 0.95rem;
        }
    }

    /* Adaptations pour petits écrans */
    @media (max-width: 768px) {
        .btn-action {
            min-width: 150px;
            padding: 0.8rem 1rem;
            font-size: 0.9rem;
        }
    }

    /* Adaptations pour mobile */
    @media (max-width: 576px) {
        .btn-action {
            min-width: 120px;
            padding: 0.7rem 0.9rem;
            font-size: 0.85rem;
        }

        /* Sur très petits écrans, on passe en disposition verticale */
        @media (max-width: 400px) {
            .action-buttons {
                flex-direction: column;
            }

            .btn-action {
                width: 100%;
                min-width: auto;
                padding: 0.75rem;
            }
        }
    }
    /* Styles de base pour les boutons d'actions */
    #add-to-favorites,
    #add-to-watchlist,
    #mark-as-watched {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
        border-radius: 25px;
        transition: var(--transition);
        min-width: 180px; /* Largeur réduite par défaut */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        white-space: nowrap;
    }

    /* Adaptation tablette */
    @media (max-width: 992px) {
        #add-to-favorites,
        #add-to-watchlist,
        #mark-as-watched {
            min-width: 160px;
            padding: 0.9rem 1rem;
            font-size: 0.95rem;
        }
    }

    /* Adaptation mobile paysage */
    @media (max-width: 768px) {
        #add-to-favorites,
        #add-to-watchlist,
        #mark-as-watched {
            min-width: 140px;
            padding: 0.8rem 0.9rem;
            font-size: 0.9rem;
        }

        /* Masquer le texte pour gagner de la place */
        .btn-action .btn-text {
            display: none;
        }

        /* Afficher seulement l'icône */
        .btn-action i {
            margin-right: 0;
            font-size: 1.2rem;
        }
    }

    /* Adaptation mobile portrait */
    @media (max-width: 576px) {
        .action-buttons {
            justify-content: space-between;
            gap: 0.5rem;
        }

        #add-to-favorites,
        #add-to-watchlist,
        #mark-as-watched {
            min-width: 30%;
            padding: 0.7rem 0.5rem;
            font-size: 0;
        }

        /* Ajustement spécifique pour le bouton trailer */
        #watch-trailer {
            min-width: 100%;
            order: 1; /* Le place en dessous */
            margin-top: 0.5rem;
            font-size: 0.85rem;
        }

        .btn-action i {
            font-size: 1.1rem;
            margin: 0 auto;
        }
    }

    /* Très petits écrans */
    @media (max-width: 400px) {
        #add-to-favorites,
        #add-to-watchlist,
        #mark-as-watched {
            min-width: 32%;
            padding: 0.6rem 0.3rem;
        }

        .btn-action i {
            font-size: 1rem;
        }
    }
    /* Pour les très petits écrans */
    @media (max-width: 400px) {
        .btn-action {
            padding: 0.65rem 0.9rem;
            font-size: 0.85rem;
        }

        .action-buttons {
            gap: 0.5rem;
        }
    }

    .section-title {
        font-size: 2rem;
    }

    .providers-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 768px) {
    .movie-hero-section {
        height: 80vh;
        min-height: 500px;
        margin: 1rem 0.5rem;
        background-attachment: scroll;
    }

    .movie-hero-content {
        padding: 2rem 0;
    }

    .movie-title {
        font-size: 2.5rem;
    }

    .movie-overview {
        font-size: 1rem;
    }

    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-action {
        min-width: auto;
        width: 100%;
    }

    .rating-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .star-rating .star {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-title::after {
        left: 0;
        width: 60px;
    }

    .cast-carousel {
        gap: 1rem;
    }

    .cast-member {
        width: 120px;
        padding: 1rem;
    }

    .cast-member img {
        width: 60px;
        height: 60px;
    }

    .providers-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .trailer-container iframe {
        height: 300px;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 70px;
    }

    .movie-hero-section {
        margin: 0.5rem;
    }

    .movie-title {
        font-size: 2rem;
    }

    .movie-overview {
        font-size: 0.95rem;
    }

    .content-section {
        margin: 2rem 0.5rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .title-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .cast-member {
        width: 100px;
        padding: 0.75rem;
    }

    .cast-member img {
        width: 50px;
        height: 50px;
    }

    .provider-section {
        padding: 1.5rem;
    }

    .providers-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .trailer-container {
        padding: 1.5rem;
    }

    .trailer-container iframe {
        height: 250px;
    }

    .navbar-brand .brand-text {
        font-size: 1rem;
    }

    .nav-link {
        padding: 0.5rem !important;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .movie-hero-section {
        height: 70vh;
        min-height: 400px;
        margin: 0;
        border-radius: 0;
    }

    .movie-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .movie-overview {
        font-size: 0.9rem;
    }

    .btn-action {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .title-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .cast-member {
        width: 90px;
        padding: 0.5rem;
    }

    .cast-member img {
        width: 40px;
        height: 40px;
    }

    .provider-card {
        padding: 1rem;
    }

    .provider-logo {
        width: 50px;
        height: 50px;
    }

    .trailer-container iframe {
        height: 200px;
    }
}

@media (max-width: 400px) {
    .action-buttons {
        gap: 0.5rem;
    }

    .btn-action {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Lazy loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}