/* Variables pour les pages de détails */
:root {
    --primary: #00a84d;
    --primary-dark: #008a3d;
    --primary-light: #00c45d;
    --secondary: #2d3436;
    --dark: #121212;
    --dark-light: #181818;
    --darker: #0a0a0a;
    --light: #f5f6fa;
    --light-gray: #dfe6e9;
    --gray: #b2bec3;
    --dark-gray: #636e72;
    --success: #00a84d;
    --warning: #fdcb6e;
    --danger: #e17055;
    --info: #74b9ff;
    --transition: all 0.3s ease;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Styles de base */
body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 25%, #2d2d2d 50%, #1a1a1a 75%, #0a0a0a 100%);
    color: var(--light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
}

/* ::after : ne pas occuper body::before (overlay menu mobile dans header-unified-new.css) */
body[data-page="anime-details"]::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 168, 77, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 168, 77, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 168, 77, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.details-container {
    padding-top: 100px;
    min-height: 100vh;
}

body[data-page="anime-details"] .details-container {
    flex: 1 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 40px;
}

/* Bouton retour */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--light);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 30px;
}

.back-button:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 77, 0.3);
}

/* En-tête principal */
.details-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.details-poster {
    flex: 0 0 320px;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.details-poster img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.details-poster:hover img {
    transform: scale(1.05);
}

.details-info {
    flex: 1;
    min-width: 350px;
}

.details-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--light);
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 168, 77, 0.3);
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.details-score {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.details-type {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.details-year {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--light);
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Section synopsis */
.synopsis-section {
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: none;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.synopsis-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--light);
}

.synopsis-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--light-gray);
    text-align: justify;
    position: relative;
}

/* Autres saisons / volumes (défilement horizontal) */
.related-seasons-section {
    background: rgba(0, 0, 0, 0.52);
    border-radius: var(--border-radius);
    padding: 16px 18px 14px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.related-seasons-section.is-loading {
    border-color: rgba(0, 168, 77, 0.35);
}

.related-seasons-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-seasons-loading-track {
    display: flex;
    gap: 14px;
    overflow: hidden;
}

.related-season-skeleton-card {
    flex: 0 0 200px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.related-season-skeleton-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: mw-skeleton-shimmer 1.2s ease-in-out infinite;
}

.related-season-skeleton-line {
    height: 12px;
    margin: 10px 10px 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    animation: mw-skeleton-shimmer 1.2s ease-in-out infinite;
}

.related-season-skeleton-line.short {
    width: 55%;
    margin-bottom: 10px;
}

.related-seasons-loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    font-size: 0.9rem;
    color: rgba(223, 230, 233, 0.85);
}

@keyframes mw-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.related-seasons-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--light);
}

.related-seasons-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-seasons-track-wrap {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.related-seasons-track {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) rgba(255, 255, 255, 0.1);
}

.related-seasons-section.has-overflow .related-seasons-track {
    scrollbar-width: none;
}

.related-seasons-section.has-overflow .related-seasons-track::-webkit-scrollbar {
    display: none;
}

.related-seasons-track::-webkit-scrollbar {
    height: 5px;
}

.related-seasons-track::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.related-seasons-nav {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: var(--light);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.related-seasons-section.has-overflow .related-seasons-nav,
.related-seasons-section.has-many-cards .related-seasons-nav {
    display: flex;
}

.related-seasons-nav:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.related-seasons-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.related-season-card {
    flex: 0 0 200px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.related-season-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 168, 77, 0.55);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 168, 77, 0.25);
}

.related-season-card.is-current {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 10px 28px rgba(0, 168, 77, 0.3);
}

.related-season-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    max-height: 252px;
    min-height: 0;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0.5) 0%, rgba(8, 8, 8, 0.9) 100%);
    overflow: hidden;
}

.related-season-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}

.related-season-badge.is-main {
    background: rgba(0, 168, 77, 0.85);
    border-color: rgba(0, 168, 77, 0.5);
}

.related-season-badge.is-side {
    background: rgba(52, 120, 200, 0.85);
    border-color: rgba(100, 160, 230, 0.45);
}

.related-season-badge.is-spinoff,
.related-season-badge.is-extra {
    background: rgba(120, 80, 160, 0.88);
    border-color: rgba(180, 140, 220, 0.4);
}

.related-season-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.related-season-poster img.is-hidden {
    display: none;
}

.related-season-poster-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.5rem;
}

.related-season-poster-fallback.is-hidden {
    display: none;
}

.related-season-poster--publication {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px 10px 12px;
    background: linear-gradient(165deg, rgba(0, 168, 77, 0.12) 0%, rgba(0, 0, 0, 0.75) 100%);
}

.related-season-pub-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    text-align: left;
}

.related-season-pub-row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.25;
}

.related-season-pub-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(0, 168, 77, 0.95);
}

.related-season-pub-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.related-season-card:not(.is-current) .related-season-info {
    min-height: auto;
}

.related-season-info {
    padding: 10px 10px 11px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.22);
    min-height: 0;
}

.related-season-card:not(.is-current) .related-season-info {
    padding-bottom: 10px;
}

.related-season-meta:empty {
    display: none;
    margin: 0;
    padding: 0;
    height: 0;
}

.related-season-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--light);
    line-height: 1.2;
}

.related-season-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--light-gray);
    line-height: 1.3;
    opacity: 0.92;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-season-meta,
.related-season-year {
    display: block;
    margin-top: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(223, 230, 233, 0.75);
    letter-spacing: 0.02em;
}

.related-season-details {
    margin-top: 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.related-season-detail-row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.25;
}

.related-season-detail-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(0, 168, 77, 0.95);
}

.related-season-detail-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.related-season-dates-overlay {
    display: none !important;
}

/* Section genres */
.genres-section {
    margin-top: 40px;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.genres-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--light);
}

.genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.genre-tag {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.genre-tag:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 168, 77, 0.4);
    border-color: rgba(0, 168, 77, 0.3);
}

/* Section informations supplémentaires */
.additional-info {
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: none;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.additional-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--light);
}

.additional-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.additional-info li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.additional-info li:last-child {
    border-bottom: none;
}

.additional-info .label {
    font-weight: 600;
    color: var(--light);
}

.additional-info .value {
    color: var(--light-gray);
}

/* Section notation utilisateur */
.user-rating-section {
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: none;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rating-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--light);
}

.rating-stars {
    font-size: 2.45rem;
    cursor: pointer;
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.rating-stars .star {
    color: #444;
    transition: all 0.3s ease;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    position: relative;
}

.rating-stars .star.selected,
.rating-stars .star.hover {
    color: #ffd700;
    transform: scale(1.2);
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
}

.rating-stars .star:hover {
    color: #ffd700;
    transform: scale(1.25);
    text-shadow: 0 0 30px rgba(255, 215, 0, 1);
}

.rating-text {
    color: var(--light-gray);
    font-size: 0.9rem;
}

.rating-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.clear-rating-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--light-gray);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-rating-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--light);
    transform: translateY(-1px);
}

.clear-rating-btn.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .details-container {
        padding-top: 88px;
    }

    .container {
        padding: 14px 12px;
        max-width: 100%;
    }

    .back-button {
        padding: 9px 12px;
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .details-header {
        flex-direction: column;
        gap: 14px;
        margin-bottom: 20px;
    }
    
    .details-poster {
        flex: none;
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }
    
    .details-info {
        min-width: auto;
    }
    
    .details-title {
        font-size: 1.45rem;
        margin-bottom: 10px;
    }
    
    .details-meta {
        justify-content: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }

    .details-score,
    .details-type,
    .details-year {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .rating-stars {
        font-size: 1.85rem;
        gap: 4px;
        width: 100%;
        justify-content: center;
        min-height: 34px;
        flex-wrap: wrap;
        line-height: 1;
        overflow: hidden;
    }

    .rating-stars .star {
        transform-origin: center;
        line-height: 1;
        display: inline-block;
    }

    .rating-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .clear-rating-btn {
        width: auto;
        align-self: center;
        justify-content: center;
        padding: 6px 12px;
        font-size: 0.8rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: #ffffff;
        border-color: rgba(0, 168, 77, 0.6);
    }
    
    .genre-tag {
        padding: 7px 12px;
        font-size: 0.78rem;
        border-radius: 14px;
    }

    .synopsis-section,
    .additional-info,
    .user-rating-section {
        padding: 14px;
        margin-bottom: 16px;
    }

    .user-rating-section {
        background: rgba(0, 0, 0, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .synopsis-title,
    .genres-title,
    .additional-info h2,
    .rating-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .synopsis-text {
        font-size: 0.96rem;
        line-height: 1.5;
        text-align: left;
    }

    .additional-info li {
        padding: 7px 0;
        gap: 10px;
    }

    .additional-info .label,
    .additional-info .value {
        font-size: 0.85rem;
        text-align: left;
    }

    .related-seasons-section {
        padding: 16px 12px 14px;
        margin-bottom: 22px;
    }

    .related-seasons-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .related-seasons-carousel {
        gap: 6px;
    }

    .related-seasons-nav {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .related-seasons-track {
        gap: 12px;
    }

    .related-seasons-track-wrap {
        --rs-visible-cards: 2;
        --rs-card-gap: 12px;
    }

    .related-season-card {
        display: flex;
        flex-direction: column;
        flex: 0 0 calc((100% - var(--rs-card-gap)) / var(--rs-visible-cards));
        max-width: calc((100% - var(--rs-card-gap)) / var(--rs-visible-cards));
        scroll-snap-align: start;
    }

    .related-season-poster {
        position: relative;
        aspect-ratio: 2 / 3;
        max-height: none;
        min-height: 0;
        height: auto;
        flex: 0 0 auto;
    }

    .related-season-poster img {
        object-fit: cover;
        object-position: center top;
    }

    .related-season-badge {
        top: 6px;
        left: 6px;
        max-width: calc(100% - 12px);
        padding: 2px 6px;
        font-size: 0.5rem;
        letter-spacing: 0.02em;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .related-season-info {
        flex: 1 1 auto;
        padding: 9px 8px 10px;
        min-height: 78px;
    }

    .related-season-label {
        font-size: 0.82rem;
    }

    .related-season-subtitle {
        font-size: 0.66rem;
        margin-top: 3px;
    }

    .related-season-details {
        margin-top: 6px;
        gap: 3px;
    }

    .related-season-detail-label {
        font-size: 0.52rem;
    }

    .related-season-detail-value {
        font-size: 0.66rem;
    }

    .related-season-meta {
        margin-top: 4px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .related-season-poster {
        aspect-ratio: 3 / 4;
    }

    .related-season-badge {
        font-size: 0.48rem;
        padding: 2px 5px;
    }

    .related-season-info {
        min-height: 82px;
        padding: 8px 7px 10px;
    }

    .related-season-detail-label {
        font-size: 0.5rem;
    }

    .related-season-detail-value {
        font-size: 0.62rem;
    }

    .details-container {
        padding-top: 80px;
    }

    .container {
        padding: 10px 8px;
    }

    .details-title {
        font-size: 1.25rem;
    }
    
    .details-meta {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 6px;
    }
    
    .rating-stars {
        font-size: 1.7rem;
        gap: 3px;
        width: 100%;
        justify-content: center;
        min-height: 30px;
        flex-wrap: wrap;
        line-height: 1;
        overflow: hidden;
    }

    .rating-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .clear-rating-btn {
        width: auto;
        align-self: center;
        justify-content: center;
        padding: 5px 11px;
        font-size: 0.76rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: #ffffff;
        border-color: rgba(0, 168, 77, 0.6);
    }
    
    .genre-tag {
        padding: 6px 10px;
        font-size: 0.72rem;
    }
    
    .synopsis-section,
    .additional-info,
    .user-rating-section {
        padding: 10px;
        margin-bottom: 12px;
    }

    .details-poster {
        max-width: 190px;
    }

    .synopsis-title,
    .genres-title,
    .additional-info h2,
    .rating-title {
        font-size: 0.98rem;
    }

    .synopsis-text {
        font-size: 0.88rem;
    }

    .additional-info li {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}