/* Enhanced Stories CSS - Fullscreen, Overlays, and Controls */

/* Container Principal */
#foo-stories-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 999999 !important; /* Z-index máximo para sobrepor tudo */
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Forçar exibição quando ativo via JS */
#foo-stories-viewer.active {
    display: flex !important;
}

.foo-viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mídia (Imagem/Vídeo) */
.foo-viewer-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.foo-viewer-media img,
.foo-viewer-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Cabeçalho com Barra de Progresso */
.foo-viewer-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    padding: 15px;
}

.foo-progress-bar-container {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
}

.foo-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.foo-progress-fill {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s linear;
}

/* Informações do Usuário (Canto Superior Esquerdo) */
.foo-viewer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.foo-viewer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

.foo-viewer-user-info {
    display: flex;
    flex-direction: column;
}

.foo-viewer-name {
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.foo-viewer-location {
    color: rgba(255,255,255,0.8);
    font-size: 11px;
}

.foo-viewer-name a {
    color: #fff;
    text-decoration: none;
}

.foo-viewer-name a:hover {
    text-decoration: underline;
}

/* Botão Seguir (Ao lado do nome) */
.foo-viewer-follow-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid #fff;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.foo-viewer-follow-btn:hover {
    background: rgba(255,255,255,0.3);
}

.foo-viewer-follow-btn.following {
    background: rgba(255,255,255,0.3);
}

/* Botões de Ação (Canto Direito) */
.foo-viewer-actions {
    position: absolute;
    right: 20px;
    bottom: 120px; /* Movido para baixo para melhor alcance no mobile */
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.foo-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(0,0,0,0.3);
    border: none;
    color: #fff;
    padding: 15px;
    border-radius: 50%;
    width: 65px; /* Aumentado */
    height: 65px; /* Aumentado */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 28px; /* Ícones maiores */
}

.foo-action-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.foo-action-btn-count {
    font-size: 11px;
    font-weight: bold;
}

/* Botão de Curtir */
.foo-like-btn {
    position: relative;
}

.foo-like-btn.liked {
    color: #ff4458;
}

/* Botão de Compartilhar */
.foo-share-btn {
    position: relative;
}

/* Botão de Som */
.foo-sound-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    z-index: 100;
}

.foo-sound-btn:hover {
    background: rgba(255,255,255,0.2);
}

.foo-sound-btn.muted::before {
    content: '🔇';
}

.foo-sound-btn.unmuted::before {
    content: '🔊';
}

/* Texto do Story */
.foo-viewer-text {
    position: absolute;
    bottom: 100px;
    left: 20px;
    right: 80px;
    color: #fff;
    font-size: 16px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    z-index: 100;
    line-height: 1.4;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
}

/* Contagem de Visualizações (Canto Inferior Esquerdo) */
.foo-viewer-views {
    position: absolute;
    bottom: 20px;
    left: 15px;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 100;
}

.foo-share-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ícone de compartilhar padrão social (usando SVG ou caractere similar) */
.foo-share-btn span::before {
    content: '🔗'; /* Pode ser substituído por um ícone SVG se necessário */
    font-size: 24px;
}

/* Informações de Oferta Relâmpago (Centro Inferior) */
.foo-flash-offer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 100, 0, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    z-index: 100;
    max-width: 80%;
}

.foo-flash-offer-price {
    font-size: 18px;
    font-weight: bold;
}

.foo-flash-offer-timer {
    font-size: 12px;
    margin-top: 5px;
}

/* Rodapé com Link (Se houver) */
.foo-viewer-footer {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.foo-viewer-link {
    display: inline-block;
    background: #fff;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.foo-viewer-link:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

/* Botão Fechar */
.foo-viewer-close {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    background: rgba(0,0,0,0.3);
    border: none;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 100;
}

.foo-viewer-close:hover {
    background: rgba(0,0,0,0.6);
}

/* Navegação (Anterior/Próximo) */
.foo-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.foo-viewer-nav:hover {
    background: rgba(255,255,255,0.2);
}

.foo-viewer-nav-prev {
    left: 15px;
}

.foo-viewer-nav-prev::before {
    content: '‹';
    font-size: 32px;
}

.foo-viewer-nav-next {
    right: 15px;
}

.foo-viewer-nav-next::before {
    content: '›';
    font-size: 32px;
}

/* Menu de Compartilhamento (Dropdown) */
.foo-share-menu {
    position: absolute;
    right: 80px;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 101;
}

.foo-share-menu.active {
    display: flex;
}

.foo-share-option {
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.foo-share-option:hover {
    background: rgba(255,255,255,0.1);
}

/* Responsividade - Foco em Mobile */
@media (max-width: 768px) {
    .foo-viewer-content {
        width: 100%;
        height: 100%;
    }

    .foo-viewer-actions {
        right: 15px;
        bottom: 100px;
        gap: 15px;
    }

    .foo-action-btn {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }

    .foo-viewer-text {
        left: 15px;
        right: 85px;
        bottom: 90px;
        font-size: 14px;
    }

    .foo-action-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .foo-viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .foo-viewer-close {
        width: 40px;
        height: 40px;
        font-size: 28px;
        top: 10px;
        left: 10px;
    }

    .foo-sound-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        top: 10px;
        right: 10px;
    }

    .foo-viewer-views {
        bottom: 15px;
        left: 10px;
        font-size: 11px;
    }

    .foo-flash-offer {
        bottom: 15px;
        padding: 10px 15px;
        font-size: 12px;
    }

    .foo-flash-offer-price {
        font-size: 16px;
    }

    .foo-viewer-link {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#foo-stories-viewer {
    animation: fadeIn 0.3s ease;
}
