/**
 * ETIK.MEDIA - Styles Player Vidéo
 */

/* =====================================================
   Player Container
   ===================================================== */
.player-page {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.video-player-container {
    /* Largeur max = min entre 1200px et la largeur nécessaire pour que
       la hauteur 16:9 tienne dans le viewport (moins header, search, padding) */
    max-width: min(1200px, calc((100vh - 170px) * 16 / 9));
    margin: 0 auto;
}

/* Container du player */
.video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Video.js fluid mode - laisser Video.js gérer le ratio */
.video-player .video-js.vjs-fluid {
    width: 100%;
    max-width: 100%;
}

/* Iframes (Dailymotion, PeerTube) */
.video-player iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

.no-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--gris-900);
    color: white;
    text-align: center;
    padding: 2rem;
}

.no-player p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* =====================================================
   Video Status
   ===================================================== */
.video-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    background: var(--gris-100);
}

.video-status.success {
    background: var(--vert-fond);
    color: var(--vert-principal);
    border-left: 4px solid var(--vert-principal);
}

.video-status.warning {
    background: var(--orange-clair);
    color: var(--orange);
    border-left: 4px solid var(--orange);
}

.video-status.error {
    background: var(--rouge-clair);
    color: var(--rouge);
    border-left: 4px solid var(--rouge);
}

.video-status.info {
    background: var(--bleu-clair);
    color: var(--bleu);
    border-left: 4px solid var(--bleu);
}

.status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.status-message {
    flex: 1;
}

.status-message small {
    display: block;
    margin-top: 0.25rem;
    opacity: 0.8;
    font-size: 0.875rem;
}

/* =====================================================
   Video Details
   ===================================================== */
.video-details {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.video-page-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--gris-900);
    line-height: 1.3;
}

.video-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gris-200);
    margin-bottom: 1.5rem;
}

.meta-item {
    font-size: 0.875rem;
    color: var(--gris-600);
}

.meta-item strong {
    color: var(--gris-700);
}

.video-description {
    margin: 2rem 0;
}

.video-description h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--gris-800);
}

.video-description p {
    line-height: 1.8;
    color: var(--gris-600);
}

.video-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gris-200);
}

.link-source {
    font-size: 0.75rem;
    color: var(--gris-400);
    text-decoration: none;
    margin-left: auto;
}

.link-source:hover {
    color: var(--gris-600);
    text-decoration: underline;
}

/* =====================================================
   Blocked Content
   ===================================================== */
.blocked-content-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.blocked-content {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 600px;
}

.blocked-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.blocked-content h2 {
    font-size: 1.5rem;
    color: var(--rouge);
    margin-bottom: 1rem;
}

.blocked-reason {
    background: var(--rouge-clair);
    color: var(--rouge);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

.blocked-content p {
    color: var(--gris-600);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.blocked-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =====================================================
   Suggestions
   ===================================================== */
.suggestions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gris-200);
}

.suggestions h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--gris-800);
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.suggestion-card {
    background: var(--gris-50);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
}

.suggestion-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: white;
}

.suggestion-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.suggestion-card h4 {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: var(--gris-800);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.suggestion-card span {
    display: block;
    padding: 0 0.75rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gris-500);
}

/* =====================================================
   Mobile paysage : hauteur vidéo limitée au viewport
   ===================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .video-player {
        max-height: calc(100vh - 80px);
    }

    .video-player .video-js,
    .video-player iframe {
        max-height: calc(100vh - 80px);
    }

    .player-page {
        padding: 0.5rem 0;
    }

    .video-details {
        padding: 1rem;
        margin-top: 0.5rem;
    }

    .video-page-title {
        font-size: 1rem;
    }

    .video-metadata {
        gap: 0.5rem;
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
        font-size: 0.75rem;
    }

    .video-status {
        padding: 0.5rem;
        margin: 0.5rem 0;
        font-size: 0.85rem;
    }

    .status-icon {
        font-size: 1rem;
    }
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .video-player-container {
        padding: 0;
    }
    
    .video-player {
        border-radius: 0;
    }
    
    .video-details {
        border-radius: 0;
        margin-top: 0;
    }
    
    .video-page-title {
        font-size: 1.25rem;
    }
    
    .video-metadata {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .blocked-content {
        padding: 2rem;
        border-radius: 0;
        box-shadow: none;
    }
    
    .blocked-actions {
        flex-direction: column;
    }
    
    .suggestions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .video-status {
        flex-direction: column;
        text-align: center;
    }
    
    .suggestions-grid {
        grid-template-columns: 1fr;
    }
    
    .suggestion-card {
        display: flex;
        align-items: center;
    }
    
    .suggestion-card img {
        width: 120px;
        flex-shrink: 0;
    }
}

/* =====================================================
   Animations
   ===================================================== */
@keyframes pulseIcon {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.blocked-icon {
    animation: pulseIcon 2s ease-in-out infinite;
}

/* =====================================================
   Loading State
   ===================================================== */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* =====================================================
   Video Embed Responsive
   ===================================================== */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.embed-responsive::before {
    display: block;
    content: "";
}

.embed-responsive-16by9::before {
    padding-top: 56.25%;
}

.embed-responsive-4by3::before {
    padding-top: 75%;
}

.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
