/* Ajustes de Transparência e Layout para Modal dos Stories estilo Instagram */
#storyModal .modal-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 420px;
    width: 100%;
}

.story-carousel-container {
    position: relative;
    width: 100%;
    height: 80vh;
    max-height: 650px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    user-select: none;
}

.story-progress-bar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 25;
}

.story-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    overflow: hidden;
}

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

.story-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.story-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.story-slide.active {
    display: flex;
}

.story-media-content {
    max-width: 100%;
    max-height: 82%;
    object-fit: contain;
    border-radius: 8px;
}

.story-video-wrapper {
    width: 100%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15; /* Garante que o iframe fique acima da área de clique */
}

.story-yt-iframe {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 16; /* Mantém os controles do YouTube clicáveis */
}

.story-caption {
    position: absolute;
    bottom: 35px;
    left: 15px;
    right: 15px;
    color: #f8fafc;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    text-align: left;
    z-index: 10;
    margin: 0;
}

.story-time {
    position: absolute;
    bottom: 12px;
    right: 15px;
    color: #94a3b8;
    font-size: 11px;
    z-index: 10;
}

/* Áreas de clique para navegação (Totalmente transparentes e sem bloquear os vídeos) */
.story-nav-btn {
    position: absolute;
    bottom: 0;
    height: 40%; /* Cobre apenas a parte inferior para não atrapalhar os controles do topo do YouTube */
    width: 25%;
    z-index: 12;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent; /* Remove o destaque azul de toque no celular */
}

.story-nav-prev { left: 0; }
.story-nav-next { right: 0; }
/* ==========================================================================
   CORREÇÃO DE Z-INDEX E CLICKS PARA OS BOTÕES DO STORY
   ========================================================================== */

/* Garante que a barra de ações e o botão de apagar fiquem no topo absoluto da camada de clique */
.story-actions-bar,
.story-delete-btn,
.story-comments-drawer,
.story-header-info {
    position: relative;
    z-index: 50 !important;
    pointer-events: auto !important;
}

/* Evita que as áreas de toque laterais bloqueiem os botões do rodapé e o cabeçalho */
.story-nav-btn {
    pointer-events: auto;
    /* Ajusta a altura para não invadir a barra de ações embaixo */
    height: calc(100% - 120px) !important; 
    top: 50px !important;
}

/* Garante que os botões internos da barra de ação recebam cliques sem interferência */
.story-action-btn, 
.story-delete-btn,
.story-comments-drawer input,
.story-comments-drawer button {
    pointer-events: auto !important;
    cursor: pointer !important;
}
/* ==========================================================================
   CORREÇÃO DEFINITIVA DO BOTÃO DE APAGAR (Z-INDEX E CURSOR)
   ========================================================================== */
.story-delete-btn {
    position: absolute !important;
    top: 18px !important;
    right: 45px !important;
    z-index: 9999 !important; /* Camada absolutamente superior */
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: auto !important;
}

/* Garante que nenhum elemento pai bloqueie o hover ou o clique dele */
.story-slide, .story-carousel-container {
    position: relative;
}