/* =====================================================================
   Shorts X - Design Système Expert & Pro Mobile-First (Dark Obsidian)
   Typographie : Plus Jakarta Sans / Inter
   Zéro emoji - 100% Icônes Vectorielles SVG & Micro-animations
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-base: #06070a;
    --bg-surface: #0e1118;
    --bg-glass: rgba(18, 22, 33, 0.72);
    --bg-glass-elevated: rgba(28, 33, 49, 0.85);
    
    --primary: #f59e0b;
    --primary-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #e11d48 100%);
    --accent-red: #f43f5e;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Conteneur principal plein écran façon application native */
.app-container {
    width: 100%;
    max-width: 480px;
    height: 100%;
    height: 100dvh;
    margin: 0 auto;
    position: relative;
    background-color: #000000;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* =====================================================================
   ENTÊTE FLOTTANTE & NAVIGATION
   ===================================================================== */
.top-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 45;
    padding: 14px 16px 8px 16px;
    background: linear-gradient(180deg, rgba(6, 7, 10, 0.7) 0%, rgba(6, 7, 10, 0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.top-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.brand-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.brand-text {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.brand-text span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}



/* Filtres de catégories horizontaux */
.categories-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    padding-bottom: 2px;
}
.categories-bar::-webkit-scrollbar { display: none; }

.cat-chip {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s var(--ease-out-expo);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
}

.cat-chip.active, .cat-chip:hover {
    background: #ffffff;
    color: #090a0f;
    border-color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* =====================================================================
   FLUX SHORTS & SLIDES (SCROLL SNAP)
   ===================================================================== */
.shorts-feed {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.shorts-feed.loading {
    opacity: 0.25;
    pointer-events: none;
}
.shorts-feed::-webkit-scrollbar { display: none; }

.short-slide {
    width: 100%;
    height: 100%;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000000;
    pointer-events: auto;
}

/* Calque transparent sur la vidéo : positionné pour laisser les clics de lecture au lecteur
   tout en servant de repère pour les gestes de navigation */
.video-tap-shield {
    position: absolute;
    top: 60px;
    left: 0;
    width: calc(100% - 75px);
    height: calc(100% - 140px);
    z-index: 10;
    background: transparent;
    pointer-events: none;
    -webkit-tap-highlight-color: transparent;
}

/* Bouclier anti-redirection ciblé sur le logo tiers en haut à gauche */
.logo-shield-top-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 48px;
    z-index: 20;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Bouclier bas-droit désactivé pour libérer 100% de la barre de progression (timeline/seekbar) de la vidéo */
.logo-shield-bottom-right {
    display: none;
    pointer-events: none;
}

/* État flux vide (Zéro vidéo par défaut) */
.empty-feed {
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.empty-feed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 320px;
}

.empty-feed-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.empty-feed-icon svg {
    width: 30px;
    height: 30px;
}

.empty-feed-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.empty-feed-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* =====================================================================
   BARRE D'ACTIONS LATÉRALE DROITE (STYLE TIKTOK PRO)
   ===================================================================== */
.actions-sidebar {
    position: absolute;
    right: 14px;
    bottom: 100px;
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    outline: none;
    transition: transform 0.15s var(--ease-out-expo);
}

.action-btn:active {
    transform: scale(0.88);
}

.action-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    transition: all 0.25s var(--ease-out-expo);
    color: #ffffff;
}

.action-icon-circle svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease, fill 0.2s ease;
}

/* Like actif */
.action-btn.liked .action-icon-circle {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.6);
    color: var(--accent-red);
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.35);
}

.action-btn.liked .action-icon-circle svg {
    fill: var(--accent-red);
    stroke: var(--accent-red);
    transform: scale(1.15);
}

/* Bouton Télécharger HD */
.download-btn .action-icon-circle {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.5));
    border-color: rgba(96, 165, 250, 0.5);
    color: #60a5fa;
}

.download-btn:hover .action-icon-circle {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.action-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #e2e8f0;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

/* =====================================================================
   INFOS DU SHORT (BAS GAUCHE)
   ===================================================================== */
.short-info {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 84px;
    z-index: 35;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.short-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.short-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.short-tag svg {
    width: 11px;
    height: 11px;
}

.views-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(8px);
}

.views-pill svg {
    width: 12px;
    height: 12px;
    stroke: var(--text-secondary);
}

.short-title {
    font-size: 0.96rem;
    font-weight: 600;
    line-height: 1.4;
    color: #f8fafc;
    text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}

/* =====================================================================
   CARTE SPONSORISÉE INTERCALÉE
   ===================================================================== */
.sponsored-slide {
    background: radial-gradient(circle at center, #171536 0%, #06070a 80%);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sponsored-card {
    background: rgba(23, 21, 54, 0.65);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 24px;
    padding: 36px 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    max-width: 360px;
}

.sponsored-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 12px;
    border-radius: 9999px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sponsored-badge svg {
    width: 12px;
    height: 12px;
}

.sponsored-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.3;
}

.sponsored-desc {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.55;
}

.sponsored-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 22px;
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(225, 29, 72, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sponsored-cta svg {
    width: 18px;
    height: 18px;
}

.sponsored-cta:active {
    transform: scale(0.97);
}

/* =====================================================================
   SAS D'ENTRÉE +18 ANS (SÉCURITÉ & CONFORMITÉ)
   ===================================================================== */
.age-gate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: rgba(6, 7, 10, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    transition: opacity 0.4s var(--ease-out-expo), visibility 0.4s var(--ease-out-expo);
}

.age-gate-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.age-gate-card {
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.age-icon-wrapper {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.25);
}

.age-icon-wrapper svg {
    width: 34px;
    height: 34px;
}

.age-gate-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
}

.age-gate-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.unlock-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-size: 1.02rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.unlock-btn svg {
    width: 18px;
    height: 18px;
}

.unlock-btn:active {
    transform: scale(0.97);
}

/* =====================================================================
   MODALE DE MISE EN PAUSE ("PAUSE-AD OVERLAY")
   ===================================================================== */
.pause-ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 95;
    background: rgba(6, 7, 10, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pause-ad-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pause-ad-card {
    width: 100%;
    max-width: 360px;
    background: var(--bg-glass-elevated);
    border: 1px solid var(--border-focus);
    border-radius: 20px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

.pause-ad-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.pause-ad-header svg {
    width: 13px;
    height: 13px;
}

.pause-ad-banner {
    width: 100%;
    min-height: 150px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.resume-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.35);
}

.resume-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.resume-btn:active {
    transform: scale(0.97);
}
