/* ============================================================
   DANDALI — index.css
   Styles spécifiques à la page d'accueil (feed TikTok)
   ============================================================ */

/* ── Top bar flottante ───────────────────────────────────── */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 60px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Fond dégradé pour lisibilité sur vidéo */
.top-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(8,10,15,0.85) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

/* ── Onglets ─────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 4px;
    border-radius: 18px;
    flex: 1;
    max-width: 260px;
}

.tab {
    flex: 1;
    text-align: center;
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    padding: 6px 8px;
    border-radius: 14px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
    text-decoration: none;
    display: block;
    border: none;
    background: none;
    font-family: inherit;
}
.tab.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}
.tab:hover:not(.active) { color: rgba(255,255,255,0.85); }

/* ── Container feed ──────────────────────────────────────── */
.videos-container {
    position: fixed;
    inset: 0;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 1;
}
.videos-container::-webkit-scrollbar { display: none; }

/* ── Slide vidéo ─────────────────────────────────────────── */
.video-slide {
    scroll-snap-align: start;
    height: 100vh;
    height: 100dvh;  /* dynamic viewport height pour mobile */
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #050709;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fond flouté (thumbnail en arrière-plan) */
.video-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.video-bg-blur {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(20px) brightness(0.4);
    -webkit-backdrop-filter: blur(20px) brightness(0.4);
    background: rgba(8,10,15,0.5);
}

/* Zone lecteur vidéo */
.video-player-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Miniature YouTube */
.yt-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.yt-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.yt-placeholder iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Vidéo fichier local */
.local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    cursor: pointer;
}

/* Bouton play central */
.play-btn-big {
    position: relative;
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring), opacity 0.2s;
}
.play-btn-big:active { transform: scale(0.85); }

/* Quand iframe chargée, masquer le placeholder play */
.yt-placeholder.playing .play-btn-big {
    opacity: 0;
    pointer-events: none;
}

/* Bouton play sur vidéo locale */
.local-play-toggle {
    position: absolute;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s;
}
.video-slide:hover .local-play-toggle,
.local-play-toggle.visible {
    opacity: 1;
}

/* ── Dégradés ────────────────────────────────────────────── */
.grad-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 35%;
    background: linear-gradient(to bottom, rgba(8,10,15,0.7) 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}
.grad-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(8,10,15,0.95) 0%, rgba(8,10,15,0.5) 40%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* ── Indicateur pause (flash) ────────────────────────────── */
.pause-flash {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.pause-flash.show { opacity: 1; }

/* ── Barre de progression ────────────────────────────────── */
.progress-bar {
    position: absolute;
    bottom: calc(var(--nav-h) + 6px);
    left: 16px;
    right: 16px;
    height: 2.5px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    z-index: 10;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

/* ── Colonne actions droite ──────────────────────────────── */
.actions-col {
    position: absolute;
    right: 12px;
    bottom: calc(var(--nav-h) + 24px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: slideUp 0.4s var(--ease) forwards;
}

/* Avatar créateur */
.avatar-wrap {
    position: relative;
    width: 50px;
    height: 50px;
    margin-bottom: 14px;
    display: block;
}
.avatar-wrap::before {
    content: '';
    position: absolute;
    inset: -2.5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--gold));
    z-index: 0;
}
.avatar-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--bg);
    position: relative;
    z-index: 1;
    margin: 3px;
    display: block;
}
.avatar-follow {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    background: var(--red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
    z-index: 2;
    box-shadow: 0 2px 8px var(--red-glow);
}

/* Boutons d'action */
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px 4px;
    transition: transform 0.12s var(--ease-spring);
    text-decoration: none;
}
.action-btn:active { transform: scale(0.88); }

.action-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s, transform 0.12s var(--ease-spring), box-shadow 0.2s;
}

/* Vote actif */
.vote-btn .action-icon {
    background: rgba(230,57,70,0.15);
    border-color: rgba(230,57,70,0.25);
}
.vote-btn.voted .action-icon {
    background: rgba(230,57,70,0.4);
    border-color: var(--red);
    box-shadow: 0 0 16px var(--red-glow);
}

/* Like actif */
.like-btn.liked .action-icon {
    background: rgba(244,162,97,0.2);
    border-color: rgba(244,162,97,0.35);
}

.action-count {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    letter-spacing: 0.1px;
}

/* ── Infos talent gauche ─────────────────────────────────── */
.talent-info {
    position: absolute;
    bottom: calc(var(--nav-h) + 20px);
    left: 16px;
    z-index: 10;
    max-width: calc(100% - 84px);
    animation: slideUp 0.4s 0.05s var(--ease) both;
}

/* Badge catégorie */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Nom créateur */
.talent-name {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    line-height: 1.15;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Pseudo + ville */
.talent-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.talent-handle {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
}
.talent-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: rgba(255,255,255,0.55);
}

/* Description */
.talent-desc {
    font-size: 13px;
    font-weight: 300;
    color: rgba(255,255,255,0.85);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* Bouton voir vidéo */
.profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 9px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s var(--ease-spring);
    text-decoration: none;
}
.profile-btn:active {
    transform: scale(0.96);
    background: rgba(255,255,255,0.22);
}

/* ── État vide ───────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 16px;
    padding: 24px;
    text-align: center;
}
.empty-icon { margin-bottom: 8px; }
.empty-titre {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
}
.empty-desc { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 380px) {
    .tabs { gap: 0; }
    .tab  { font-size: 11.5px; padding: 5px 6px; }
    .talent-name { font-size: 17px; }
    .action-icon { width: 44px; height: 44px; }
    .actions-col { right: 8px; }
}

@media (min-width: 600px) {
    /* Centré sur grand écran */
    .video-player-wrap { max-width: 400px; margin: 0 auto; }
    .actions-col  { right: calc(50% - 220px); }
    .talent-info  { left: calc(50% - 200px); }
    .progress-bar { left: calc(50% - 200px); right: calc(50% - 200px); }
}

/* ── Thème clair (ajustements spécifiques au feed) ───────── */
body.light-mode .grad-top {
    background: linear-gradient(to bottom, rgba(244,245,247,0.85) 0%, transparent 100%);
}
body.light-mode .grad-bottom {
    background: linear-gradient(to top, rgba(244,245,247,0.95) 0%, rgba(244,245,247,0.5) 40%, transparent 100%);
}
body.light-mode .talent-name  { color: #0D1017; }
body.light-mode .talent-desc  { color: rgba(13,16,23,0.8); text-shadow: 0 1px 4px rgba(255,255,255,0.5); }
body.light-mode .action-count { color: rgba(13,16,23,0.9); text-shadow: none; }
body.light-mode .profile-btn  {
    background: rgba(13,16,23,0.1);
    border-color: rgba(13,16,23,0.2);
    color: #0D1017;
}
body.light-mode .category-badge {
    background: rgba(13,16,23,0.1);
    border-color: rgba(13,16,23,0.15);
    color: rgba(13,16,23,0.8);
}
