/* ============================================================================
   Woode Stories — CSS completo (Feed 3.0)
   Barra horizontal + visualizador full-screen + criação
============================================================================ */

/* ----- Barra de stories (topo do Feed) ----- */
.stories-bar {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 14px 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.stories-bar::-webkit-scrollbar { height: 4px; }
.stories-bar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.story-bubble {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    scroll-snap-align: start;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}
.story-bubble .ring {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #0F7A55, #34d399, #0F7A55);
    transition: transform .15s ease;
}
.story-bubble:hover .ring { transform: scale(1.05); }
.story-bubble.viewed .ring {
    background: var(--line);
}
.story-bubble .ring img,
.story-bubble .ring .fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg);
    display: block;
}
.story-bubble .ring .fallback {
    background: #e8f5ea;
    color: #0F7A55;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.story-bubble .s-name {
    font-size: .72rem;
    font-weight: 600;
    color: var(--ink-700);
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.story-bubble .s-badge {
    font-size: .58rem;
    color: #0F7A55;
    font-weight: 700;
}
.story-bubble.add-story .ring {
    background: var(--bg);
    border: 2px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.story-bubble.add-story .ring span {
    font-size: 1.5rem;
    color: var(--ink-400);
    line-height: 1;
}

/* ----- Visualizador de stories (overlay) ----- */
.story-viewer {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    animation: story-fade-in .2s ease;
}
.story-viewer.active { display: flex; }

@keyframes story-fade-in { from { opacity: 0; } to { opacity: 1; } }

.story-progress-bars {
    display: flex;
    gap: 3px;
    padding: 12px 14px 6px;
    z-index: 10;
}
.story-progress-bars .sp {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255,255,255,.25);
    overflow: hidden;
    cursor: pointer;
}
.story-progress-bars .sp .sp-fill {
    height: 100%;
    background: #fff;
    border-radius: 3px;
    width: 0;
    transition: width .1s linear;
}
.story-progress-bars .sp.done .sp-fill { width: 100%; }
.story-progress-bars .sp.active .sp-fill { width: var(--progress, 0%); }

.story-viewer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 10px;
    z-index: 10;
}
.story-viewer-head .sv-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.6);
}
.story-viewer-head .sv-name {
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
}
.story-viewer-head .sv-time {
    color: rgba(255,255,255,.6);
    font-size: .75rem;
}
.story-viewer-head .sv-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.story-viewer-head .sv-actions button {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: background .15s;
}
.story-viewer-head .sv-actions button:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Área do conteúdo do story */
.story-viewer-body {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
}
.story-viewer-body img.story-media,
.story-viewer-body video.story-media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.story-viewer-body .story-text-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: pre-wrap;
}
.story-bg-gradient-1 { background: linear-gradient(135deg, #0F7A55, #064E3B); }
.story-bg-gradient-2 { background: linear-gradient(135deg, #7C3AED, #DB2777); }
.story-bg-gradient-3 { background: linear-gradient(135deg, #F59E0B, #EF4444); }
.story-bg-gradient-4 { background: linear-gradient(135deg, #0EA5E9, #6366F1); }
.story-bg-gradient-5 { background: linear-gradient(135deg, #1F2937, #111827); }
.story-bg-solid-1 { background: #0F7A55; }
.story-bg-solid-2 { background: #7C3AED; }
.story-bg-solid-3 { background: #F59E0B; }

/* Card de evento dentro do story */
.story-event-card {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 340px;
    background: rgba(255,255,255,.95);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    text-decoration: none;
    color: inherit;
    z-index: 5;
}
.story-event-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}
.story-event-card .sec-info {
    padding: 12px 14px;
}
.story-event-card .sec-name {
    font-weight: 700;
    font-size: .95rem;
    margin: 0 0 4px;
    color: #111;
}
.story-event-card .sec-meta {
    font-size: .78rem;
    color: #666;
    margin: 0 0 8px;
}
.story-event-card .sec-btn {
    display: inline-block;
    background: #0F7A55;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    text-decoration: none;
}

/* Legenda/caption */
.story-caption {
    position: absolute;
    bottom: 80px;
    left: 14px;
    right: 14px;
    color: #fff;
    font-size: .9rem;
    text-shadow: 0 1px 6px rgba(0,0,0,.7);
    z-index: 4;
    padding: 0 10px;
    text-align: center;
}

/* Navegação (setas) */
.story-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    transition: background .15s;
}
.story-nav:hover { background: rgba(255,255,255,.3); }
.story-nav.prev { left: 8px; }
.story-nav.next { right: 8px; }
@media (min-width: 700px) {
    .story-nav.prev { left: 20px; }
    .story-nav.next { right: 20px; }
}

/* Rodapé: reações e resposta */
.story-viewer-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
    z-index: 10;
}
.story-react-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform .1s;
    filter: grayscale(1) opacity(.6);
}
.story-react-btn.reacted {
    filter: none;
    transform: scale(1.2);
}
.story-reply-input {
    flex: 1;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 22px;
    color: #fff;
    padding: 9px 16px;
    font-size: .88rem;
    outline: none;
}
.story-reply-input::placeholder { color: rgba(255,255,255,.5); }
.story-reply-send {
    background: #0F7A55;
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: .95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ----- Criação de story ----- */
.story-create-type {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.story-create-type button {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--line);
    background: var(--bg);
    border-radius: var(--radius-sm, 8px);
    font-weight: 600;
    font-size: .85rem;
    color: var(--ink-600);
    cursor: pointer;
    transition: border-color .15s;
}
.story-create-type button.active {
    border-color: #0F7A55;
    color: #0F7A55;
}
.story-bg-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.story-bg-picker button {
    height: 56px;
    border-radius: 10px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: border-color .15s;
}
.story-bg-picker button.active {
    border-color: #0F7A55;
}

/* ----- Skeleton loading do feed ----- */
.skeleton {
    border-radius: var(--radius-sm, 8px);
    background: linear-gradient(90deg, var(--bg) 25%, var(--line) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-post {
    padding: 16px;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--line);
    margin-bottom: 14px;
}
.skeleton-post .sk-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.skeleton-post .sk-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-post .sk-line { height: 12px; border-radius: 6px; margin-bottom: 8px; }
.skeleton-post .sk-line.short { width: 40%; }
.skeleton-post .sk-line.medium { width: 70%; }
.skeleton-post .sk-image { height: 200px; margin-top: 12px; }

/* ----- Feed 3.0 layout ----- */
.feed-3d {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 600px;
    margin: 0 auto;
}
@media (min-width: 1024px) {
    .feed-3d {
        grid-template-columns: minmax(0, 600px) 280px;
        max-width: 920px;
    }
    .feed-3d .feed-main { grid-column: 1; }
    .feed-3d .feed-aside { grid-column: 2; }
}
.feed-3d .feed-aside { display: none; }
@media (min-width: 1024px) {
    .feed-3d .feed-aside { display: block; }
}
.feed-3d .feed-aside .aside-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md, 12px);
    padding: 14px;
    margin-bottom: 14px;
    background: var(--bg);
}
.feed-3d .feed-aside h3 {
    font-size: .85rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--ink-800);
}

/* Enquete nos posts */
.post-poll {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 8px);
    padding: 12px;
    margin-top: 10px;
}
.post-poll .poll-question {
    font-weight: 700;
    font-size: .9rem;
    margin: 0 0 10px;
    color: var(--ink-800);
}
.post-poll .poll-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--ink-700);
    transition: border-color .15s, background .15s;
    position: relative;
    overflow: hidden;
}
.post-poll .poll-option:hover { border-color: #0F7A55; }
.post-poll .poll-option .poll-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(15,122,85,.1);
    z-index: 0;
    transition: width .3s ease;
}
.post-poll .poll-option .poll-label,
.post-poll .poll-option .poll-count {
    position: relative;
    z-index: 1;
}
.post-poll .poll-option.my-vote {
    border-color: #0F7A55;
    background: rgba(15,122,85,.05);
}
.post-poll .poll-meta {
    font-size: .72rem;
    color: var(--ink-400);
    margin-top: 6px;
}

/* Compartilhar por DM */
.share-dm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.share-dm-modal.active { display: flex; }
.share-dm-card {
    background: var(--bg);
    border-radius: var(--radius-md, 12px);
    padding: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}
.share-dm-card h3 { margin: 0 0 14px; font-size: 1rem; }
.share-dm-list { display: flex; flex-direction: column; gap: 6px; }
.share-dm-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.share-dm-user:hover { background: rgba(15,122,85,.08); }
.share-dm-user img, .share-dm-user .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .story-viewer { animation: none; }
    .skeleton { animation: none; opacity: .6; }
    .story-bubble:hover .ring { transform: none; }
}

/* ----- Cartão de transferência (Repassa 2.0) ----- */
.chat-transfer {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    margin: 6px 0;
    background: var(--bg);
    max-width: 320px;
}
.chat-transfer-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.chat-transfer-ico { font-size: 1.2rem; }
.chat-transfer-title { font-weight: 700; font-size: .85rem; color: var(--ink-800); }
.chat-transfer-status {
    margin-left: auto;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}
.chat-transfer-status.st-pending { background: #FFF3CD; color: #856404; }
.chat-transfer-status.st-accepted { background: #D4EDDA; color: #155724; }
.chat-transfer-status.st-declined { background: #F8D7DA; color: #721C24; }
.chat-transfer-status.st-cancelled { background: #E2E3E5; color: #383D41; }
.chat-transfer-status.st-expired { background: #E2E3E5; color: #6C757D; }
.chat-transfer-event { margin: 0 0 2px; }
.chat-transfer-people { margin: 0 0 8px; }
.chat-transfer .btn { margin-right: 4px; }

/* ----- Form de convite para rolê ----- */
.chat-invite-form { display: inline; }
.chat-invite-form .btn { width: 100%; justify-content: center; }
