/*patch taille étoile*/

.movie-modal-rating-section {
    border-radius: 16px;
    position: relative;
    padding: 0 12px;
    margin: 0 0 16px 0;
}

.rating-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
}

.rating-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.rating-stars-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
}

.movie-modal-stars {
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    gap: 5px !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow: visible !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-star-new {
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-touch-callout: none;
    font-size: clamp(22px, 7vw, 36px) !important;
}

.modal-star-new.full {
    color: #fbbf24;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

.modal-star-new.half {
    background: linear-gradient(90deg, #fbbf24 50%, rgba(255, 255, 255, 0.2) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.3));
}

.modal-star-new:hover {
    transform: scale(1.15);
}

.modal-star-new:active {
    animation: starClick 0.3s ease;
}

@media (min-width: 1025px) {
    .modal-star-new {
        font-size: 34px !important;
    }
    .movie-modal-rating-section {
        padding: 0 16px;
        margin-bottom: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .modal-star-new {
        font-size: clamp(28px, 6vw, 32px) !important;
    }
    .movie-modal-rating-section {
        padding: 0 14px;
        margin-bottom: 18px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .modal-star-new {
        font-size: clamp(26px, 6.5vw, 30px) !important;
    }
    .movie-modal-rating-section {
        padding: 0 12px;
        margin-bottom: 16px;
    }
}

@media (min-width: 381px) and (max-width: 480px) {
    .modal-star-new {
        font-size: clamp(24px, 7vw, 28px) !important;
    }
    .movie-modal-rating-section {
        padding: 0 10px;
        margin-bottom: 16px;
    }
}

@media (min-width: 321px) and (max-width: 380px) {
    .modal-star-new {
        font-size: clamp(22px, 7.5vw, 26px) !important;
    }
    .movie-modal-rating-section {
        padding: 0 8px;
        margin-bottom: 14px;
    }
}

@media (max-width: 320px) {
    .modal-star-new {
        font-size: clamp(20px, 8vw, 24px) !important;
    }
    .movie-modal-rating-section {
        padding: 0 6px;
        margin-bottom: 12px;
    }
}

/*boutton clear étoiles*/

.rating-clear-btn {
    position: absolute;
    top: -8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: #ef4444;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rating-clear-btn:hover {
    background: #dc2626;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

.rating-clear-btn:active {
    transform: scale(0.95);
}

.rating-clear-btn svg {
    width: 12px;
    height: 12px;
}

@keyframes starClick {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes starPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); }
    50% { filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.8)); }
}

.modal-star-new.full {
    animation: starPulse 2s ease-in-out infinite;
}

/*patch navbar mobile*/



.movie-card.filtered {
    opacity: 0.5;
    pointer-events: none;
}

.movie-card.filtered::after {
    content: '18+';
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

/*patch bouton actoin modal movie*/

.movie-modal-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    padding: 0 16px;
}

.action-btn {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
    padding: 0 !important;
}

.action-btn svg {
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

@media (max-width: 480px) {
    .movie-modal-actions {
        gap: 12px;
        padding: 0 12px;
    }
    .action-btn {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        max-width: 56px !important;
        max-height: 56px !important;
    }
    .action-btn svg {
        width: 26px !important;
        height: 26px !important;
    }
}

@media (max-width: 360px) {
    .movie-modal-actions {
        gap: 10px;
        padding: 0 8px;
    }
    .action-btn {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        max-width: 52px !important;
        max-height: 52px !important;
    }
    .action-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
}

@media (max-width: 320px) {
    .movie-modal-actions {
        gap: 8px;
        padding: 0 6px;
    }
    .action-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
    }
    .action-btn svg {
        width: 22px !important;
        height: 22px !important;
    }
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.action-btn:active {
    animation: buttonPulse 0.3s ease;
}

.action-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.action-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}









/* tach pour corriger le modal movie après l'uploda des retours arrière */

#movieModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow: hidden;
}

#movieModal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Le contenu doit être centré et scrollable */
#movieModal .modal-content {
    padding: 0;
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-dark);
    position: relative;
    transform: none;
}

.movie-modal-new {
    position: relative;
    min-height: 100vh;
    background: var(--bg-dark);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}





/* ==================== WIDGET DE RECHERCHE FLOTTANT ==================== */

.search-widget {
    position: fixed;
    bottom: 100px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    backdrop-filter: none;
    border-radius: 50%;
    z-index: 99;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: visible;
    width: 50px;
    height: 50px;
    border: none;
    padding: 0;
}

.search-widget.active {
    width: 320px;
    border-radius: 50px;
    background: rgba(20, 24, 28, 0.92);
    backdrop-filter: blur(20px);
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(59, 130, 246, 0.1) inset;
}

/* Input de recherche */
.search-widget .search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 15px;
    padding: 0 60px 0 24px;
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease 0.1s;
    font-weight: 500;
}

.search-widget.active .search-input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
}

.search-widget .search-input::placeholder {
    color: rgba(156, 163, 175, 0.6);
}

/* Bouton de recherche */
.search-widget .search-btn {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    border-radius: 50%;
    color: rgba(147, 197, 253, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    order: 2;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.search-widget .search-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    color: rgba(147, 197, 253, 1);
}

.search-widget .search-btn:active {
    transform: scale(0.98);
}

.search-widget .search-btn svg {
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

.search-widget.active .search-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(59, 130, 246, 0.5);
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
}

.search-widget.active .search-btn:hover {
    background: rgba(30, 41, 59, 1);
    transform: translateY(-50%) scale(1.08);
}

.search-widget.active .search-btn svg {
    width: 20px;
    height: 20px;
}

/* Animation d'apparition */
@keyframes slideInWidget {
    from {
        opacity: 0;
        transform: translateX(100px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.search-widget {
    animation: slideInWidget 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile */
@media (max-width: 768px) {
    .search-widget {
        bottom: 88px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .search-widget.active {
        width: calc(100% - 32px);
    }

    .search-widget .search-btn {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .search-widget.active .search-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        right: 3px;
    }

    .search-widget .search-input {
        font-size: 14px;
        padding: 0 52px 0 20px;
    }
}

@media (max-width: 480px) {
    .search-widget {
        width: 46px;
        height: 46px;
    }

    .search-widget .search-btn {
        width: 46px;
        height: 46px;
        min-width: 46px;
        min-height: 46px;
    }

    .search-widget.active .search-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .search-widget .search-btn svg {
        width: 20px;
        height: 20px;
    }

    .search-widget.active .search-btn svg {
        width: 18px;
        height: 18px;
    }

    .search-widget .search-input {
        padding: 0 48px 0 16px;
        font-size: 13px;
    }
}

/* État de recherche active - indicateur visuel */
.search-widget.searching::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.5),
        rgba(147, 197, 253, 0.5),
        rgba(59, 130, 246, 0.5)
    );
    border-radius: 50px;
    z-index: -1;
    animation: gradientShift 3s linear infinite;
    background-size: 200% 100%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}


/* =====================================================
   PATCH NOTATION : affichage conditionnel uniquement
   Ajouter à la fin de responsive-patches.css
   ===================================================== */

/* Section notation cachée par défaut */
.movie-modal-rating-section {
    display: none !important;
}

.movie-modal-rating-section.rating-visible {
    display: block !important;
    animation: ratingSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ratingSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}


/* =====================================================
   WATCHED DATE PICKER
   ===================================================== */

.watched-date-picker {
    margin: 0 16px 16px;
    padding: 12px 14px;
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 14px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.watched-date-picker.wdp-visible {
    opacity: 1;
    transform: translateY(0);
}

.wdp-label {
    font-size: 12px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Le "· Changer ?" en plus discret */
.wdp-label-hint {
    font-weight: 400;
    opacity: 0.6;
    font-size: 11px;
}

.wdp-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wdp-btn {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1.5px solid rgba(16, 185, 129, 0.25);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.wdp-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
}

/* "Aujourd'hui" — style confirmé, pas besoin de cliquer */
.wdp-btn.wdp-active {
    background: #10b981;
    border-color: #10b981;
    color: white;
    cursor: default; /* pas de pointeur : déjà sélectionné */
    opacity: 0.85;
}

.wdp-btn.wdp-active:hover {
    transform: none;
    background: #10b981;
}

.wdp-btn.wdp-longago {
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-muted);
    font-style: italic;
}

.wdp-btn.wdp-longago:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.1);
}

/* Input date custom */
.wdp-custom-input {
    margin-top: 10px;
    animation: wdpInputSlide 0.2s ease;
}

@keyframes wdpInputSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wdp-custom-input input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.wdp-custom-input input[type="date"]:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

@media (max-width: 480px) {
    .watched-date-picker {
        margin: 0 12px 14px;
        padding: 10px 12px;
    }
    .wdp-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* =====================================================
   FRIEND PROFILE — MODAL "VOIR TOUT" — BARRE DE TRI
   ===================================================== */

/* En-tête du modal avec titre + contrôles */
.fam-header {
    padding: 22px 24px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.fam-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fam-title-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Barre de tri */
.fam-sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fam-sort-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Select stylisé — même look que les filtres watchlist/watched */
.fam-sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 36px 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    min-width: 160px;
    max-width: 260px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.fam-sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fam-sort-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Compteur de films */
.fam-count-badge {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 5px 12px;
    white-space: nowrap;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
}

/* Zone grille */
.fam-grid-wrapper {
    padding: 16px 24px 28px;
}

/* Grille de posters — même style que friend-profile-movies */
.fam-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

/* Les cartes dans la grille prennent toute la largeur de leur colonne */
.fam-grid .friend-profile-movie {
    width: 100%;
    min-width: unset;
    max-width: unset;
    flex: unset;
}

/* Loader centré pendant le chargement */
.fam-loader {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

/* État vide */
.fam-empty {
    width: 100%;
    text-align: center;
    padding: 48px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Animation d'apparition des cartes */
.friend-profile-movie {
    animation: famCardIn 0.25s ease both;
}

@keyframes famCardIn {
    from { opacity: 0; transform: scale(0.94) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .fam-header {
        padding: 18px 16px 12px;
    }

    .fam-title {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .fam-sort-select {
        font-size: 12px;
        padding: 7px 30px 7px 12px;
        min-width: 130px;
    }

    .fam-count-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .fam-grid-wrapper {
        padding: 12px 16px 20px;
    }

    .fam-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .fam-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}













/* ─── Skeleton / Shimmer — à ajouter dans ton CSS principal ─── */

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.10) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite linear;
    border-radius: 6px;
    display: inline-block;
}

/* Chips de meta (année / durée / note) */
.skeleton-chip {
    width: 68px;
    height: 22px;
    border-radius: 20px;
    margin-right: 8px;
}

/* Pills de genre */
.skeleton-pill {
    width: 72px;
    height: 26px;
    border-radius: 20px;
    margin-right: 6px;
}

/* Lignes de texte (synopsis) */
.skeleton-line {
    height: 14px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: block;
}

/* Avatar cast */
.skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Placeholder poster (si image pas encore connue) */
.skeleton-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    animation: shimmer 1.4s infinite linear;
    background-size: 800px 100%;
}

/* Header skeleton : fond sombre pendant que le backdrop précharge.
   Le JS sette background-image uniquement quand l'image est prête → zéro flash. */
.movie-modal-header--skeleton {
    background-color: #12121e;
    background-image: none !important;
}