/*
 * Arc_Prod File Role: Frontend asset (CSS/JS) for tenant/admin UI behavior or styling.
 * File: public_html/assets/xhelpers/css/modules/video_detail.css
 */
/**
 * XHelpers - XHelpers V1.0
 * CSS pour la page détail vidéo
 *
 * @package   XHelpers
 * @version   V1.0
 * @author    ULB
 */

/* Masquer le badge épinglé dans la vue détaillée */
.video-detail-page-content .badge-pinned,
.video-detail-page-content .pinned-badge,
.video-detail-page-content .video-header-actions .badge.bg-warning {
    display: none !important;
}

.video-detail-page-content {
    padding: 1rem 0;
}

.video-detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Navigation */
.video-nav {
    margin-bottom: 1rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border: none;
    text-decoration: none;
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
    transition: opacity 150ms ease;
}

.btn-back:hover {
    opacity: 0.60;
    background: transparent;
    color: var(--text-secondary, #6b7280);
}

/* Lecteur vidéo */
.video-player-wrapper {
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Container pour iframe (YouTube/Vimeo) */
.video-iframe-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000; /* noir pour lecteur vidéo — intentionnel */
}

.video-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Lecteur HTML5 */
.video-player-container {
    background: #000; /* noir pour lecteur vidéo — intentionnel */
}

.video-player {
    width: 100%;
    display: block;
}

/* Lien externe */
.video-external-link {
    padding: 3rem;
    text-align: center;
    background: var(--bg-primary, #fff);
}

/* Informations vidéo */
.video-info-card {
    background: transparent;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    padding: 24px 0;
    margin-bottom: 0;
}

.video-comments-section {
    border-top: 1px solid var(--token-border, #e5e7eb) !important;
}

.video-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

.video-info-header .content-quick-edit-row {
    margin: 0;
    flex-shrink: 0;
}

.video-info-header .content-quick-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-primary, #374151);
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
}

.video-info-header .content-quick-edit i {
    font-size: 1.1rem;
    line-height: 1;
}

.video-info-header .content-quick-edit:hover,
.video-info-header .content-quick-edit:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: var(--brand-text);
    transform: none;
    box-shadow: none;
    text-decoration: none;
    outline: none;
}

.video-detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* Métadonnées */
.video-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e9ecef);
    margin-bottom: 1rem;
}

.video-detail-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 100%;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color-light);
    padding: 0.2rem 0.58rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: none;
}

.category-badge-link {
    text-decoration: none;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    cursor: pointer;
}

.category-badge-link:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

.category-badge i {
    font-size: 0.72rem;
    /* Part de --brand-text et non de la marque brute : melangee telle quelle,
       une marque foncee donnait 1,98:1 en mode sombre (mesure du 2026-08-01). */
    color: color-mix(in srgb, var(--brand-text) 72%, var(--text-secondary) 28%);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
}

.meta-item i {
    font-size: 1rem;
}

/* Description */
.video-description h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

.description-content {
    color: var(--text-primary, #333);
    line-height: 1.6;
}

/* Images du contenu riche : responsive (sinon image à sa taille native -> déborde) */
.description-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem 0;
    border-radius: var(--border-radius);
}

/* Vidéos embarquées (iframe) : ratio 16/9 explicite — un iframe n'expose pas son ratio au CSS,
   sans ça la hauteur est rabattue à ~150px (vidéo écrasée). Surcharge la règle globale height:auto. */
.description-content iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 1.5rem auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

/* Tableaux — scrollables si trop larges */
.description-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
}

/* Blocs de code — scroll horizontal au lieu de déborder */
.description-content pre {
    overflow-x: auto;
    max-width: 100%;
}

/* Section partage */
.video-share-section {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 24px 0;
    margin-top: 0;
}

.video-share-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: opacity 150ms ease;
    text-decoration: none;
    color: var(--text-secondary, #6b7280);
}

.share-btn:hover {
    opacity: 0.60;
    background: transparent;
    color: var(--text-secondary, #6b7280);
}

.share-btn i {
    font-size: 1.25rem;
}

.share-btn.bookmarked {
    color: var(--brand-text);
}

/* Titre section commentaires */
.video-section-label {
    font-weight: 600 !important;
    font-size: 15px !important;
    color: var(--token-text-primary, #111827) !important;
}

/* Bouton Envoyer commentaire */
.video-comment-submit {
    display: block;
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--token-border, #e5e7eb);
    color: var(--token-text-primary, #111827);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease;
}

.video-comment-submit:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ── Navigation précédente / suivante ─────────────────────────────────────── */
.video-adjacent-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0 0.5rem;
    border-top: 1px solid var(--token-border, #e5e7eb);
    margin-top: 1.5rem;
}

.video-adj-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    max-width: 48%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--token-border, #e5e7eb);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 150ms ease, border-color 150ms ease;
}

.video-adj-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--primary-color, #384376);
    color: inherit;
    text-decoration: none;
}

.video-adj-next {
    justify-content: flex-end;
    text-align: right;
}

.video-adj-arrow {
    color: var(--token-text-secondary, #6b7280);
    font-size: 1rem;
    flex-shrink: 0;
}

.video-adj-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.video-adj-info-right {
    align-items: flex-end;
}

.video-adj-label {
    font-size: 0.72rem;
    color: var(--token-text-secondary, #6b7280);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
    margin-bottom: 2px;
}

.video-adj-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--token-text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.video-adj-spacer {
    flex: 1;
}

.video-link-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.video-link-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6c757d);
    background: var(--bg-tertiary, #f8f9fa);
}

.video-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--token-border, #e5e7eb);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--token-text-secondary, #737373);
    cursor: pointer;
    transition: background 150ms ease;
    flex-shrink: 0;
}

.video-copy-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.video-copy-btn i {
    font-size: 14px;
}

/* Bouton favoris — Apple flat style */
.btn-favorite {
    background: transparent;
    border: 2px solid var(--border-color, #e5e7eb);
    color: var(--text-secondary, #6c757d);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
    font-size: 20px;
    position: relative;
    overflow: hidden;
}

.btn-favorite:hover {
    background: transparent;
    border-color: var(--token-danger, #dc3545);
    color: var(--token-danger, #dc3545);
    transform: none;
}

.btn-favorite.bookmarked {
    background: transparent;
    border-color: var(--token-danger, #dc3545);
    color: var(--token-danger, #dc3545);
    box-shadow: none;
}

.btn-favorite.bookmarked:hover {
    opacity: 0.75;
    transform: none;
}

.btn-favorite i {
    transition: none;
}

.btn-favorite:active i {
    transform: scale(0.85);
}

/* Notification favoris — Apple flat */
.bookmark-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.12));
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bookmark-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.bookmark-notification.success {
    border-left: 4px solid var(--token-success, #22c55e);
}

.bookmark-notification.info {
    border-left: 4px solid var(--token-info, #0a84ff);
}

.bookmark-notification.error {
    border-left: 4px solid var(--token-danger, #dc3545);
}

.bookmark-notification i {
    font-size: 20px;
}

.bookmark-notification.success i {
    color: var(--token-success, #22c55e);
}

.bookmark-notification.info i {
    color: var(--token-info, #0a84ff);
}

.bookmark-notification.error i {
    color: var(--token-danger, #dc3545);
}

/* Responsive */
@media (max-width: 767.98px) {
    .video-info-header {
        flex-direction: column;
    }

    .video-info-header .content-quick-edit {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .video-detail-title {
        font-size: 1.25rem;
    }

    .video-meta-info {
        gap: 0.75rem;
    }

    .meta-item {
        font-size: 0.8rem;
    }

    .btn-favorite {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ============================================================
   Extrait de base.css §AA — Video detail title (moved 2026-03-18)
   ============================================================ */
/* ============================================================
   §AA — Apple flat pass : Favorites pages + Video detail title
   Corrige les titres trop grands issus de 04-role-badges (2.1rem)
   et 09-xh-visual-pass (28px/700 pour h3 dans les cartes favoris)
   ============================================================ */

/* 1. Video detail title : réduire de clamp(1.55rem,2.2vw,2.1rem) → 1.25rem */
body.arcprod-tenant .video-detail-page-content .video-detail-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}
