/* ============================================
   VukaSport — Feed / Novidades
   ============================================ */

/* Container principal */
#feedContainer {
    display: none;
    min-height: 60vh;
    padding-bottom: 90px;
}
#feedContainer.active { display: block; }

/* Header com filtros */
.feed-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.feed-filtros {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    scrollbar-width: none;
}
.feed-filtros::-webkit-scrollbar { display: none; }

.feed-filtro-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    background: #2a2a2a;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}
.feed-filtro-btn.active {
    background: #2EA043;
    color: #fff;
}
.feed-filtro-btn:active { opacity: 0.75; }

/* Lista de posts */
.feed-posts-lista {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

/* Card de post */
.feed-card {
    background: #1e1e1e;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    transition: box-shadow 0.2s;
}
.feed-card-pinned {
    border-color: rgba(46,160,67,0.5);
    box-shadow: 0 0 0 1px rgba(46,160,67,0.2);
}
.feed-pin-bar {
    background: rgba(46,160,67,0.12);
    color: #2EA043;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 14px;
    letter-spacing: 0.3px;
}

.feed-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 14px 0;
    position: relative;
}

.feed-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2EA043, #1e7e34);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feed-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.feed-autor {
    font-size: 14px;
    font-weight: 700;
    color: #f3f4f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.feed-tempo {
    font-size: 11px;
    color: #6b7280;
}
.feed-jogo {
    font-size: 11px;
    color: #9ca3af;
}

.feed-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Menu de ações (⋮) */
.feed-menu {
    position: relative;
}
.feed-menu-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 6px;
    font-family: inherit;
}
.feed-menu-btn:hover { background: rgba(255,255,255,0.05); }
.feed-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #252525;
    border: 1px solid #333;
    border-radius: 10px;
    min-width: 140px;
    z-index: 50;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.feed-menu-dropdown.open { display: block; }
.feed-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.feed-menu-dropdown button:hover { background: rgba(255,255,255,0.06); }
.feed-btn-apagar { color: #ef4444 !important; }

/* Texto do post */
.feed-texto {
    padding: 10px 14px;
    font-size: 14px;
    color: #d1d5db;
    line-height: 1.55;
    white-space: pre-line;
    word-break: break-word;
}

/* Imagem */
.feed-imagem {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: opacity .15s ease;
}
.feed-imagem:hover { opacity: .92; }

/* Lightbox de imagem em ecrã inteiro */
.feed-img-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
    opacity: 0;
    transition: opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.feed-img-lightbox.open { opacity: 1; }
.feed-img-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}
.feed-img-lightbox-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.feed-img-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }

/* Aviso para visitante no modal de criar post */
.feed-criar-aviso-guest {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #1e40af;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    margin: 4px 0 8px;
}
.feed-criar-aviso-guest a {
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 600;
}
:root[data-theme="dark"] .feed-criar-aviso-guest {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}
:root[data-theme="dark"] .feed-criar-aviso-guest a { color: #bfdbfe; }

/* Ações */
.feed-acoes {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px 10px;
    border-top: 1px solid #252525;
    margin-top: 6px;
}
.feed-acoes button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.feed-acoes button:hover { background: rgba(255,255,255,0.05); color: #d1d5db; }
.feed-btn-like.liked { color: #ef4444; }
.feed-btn-like:hover { color: #ef4444 !important; background: rgba(239,68,68,0.08) !important; }
.feed-btn-comment:hover { color: #3b82f6 !important; background: rgba(59,130,246,0.08) !important; }
.feed-btn-share:hover { color: #22c55e !important; background: rgba(34,197,94,0.08) !important; }

/* Skeleton loading */
.feed-skeleton {
    background: #1e1e1e;
    border-radius: 14px;
    border: 1px solid #2a2a2a;
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: sk-pulse 1.5s ease-in-out infinite;
}
@keyframes sk-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.sk-avatar { width: 38px; height: 38px; border-radius: 50%; background: #2a2a2a; flex-shrink: 0; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk-line { height: 10px; background: #2a2a2a; border-radius: 5px; }
.sk-line.w70 { width: 70%; }
.sk-line.w40 { width: 40%; }
.sk-badge { width: 60px; height: 22px; background: #2a2a2a; border-radius: 12px; flex-shrink: 0; }
.sk-body { width: 100%; height: 60px; background: #2a2a2a; border-radius: 8px; }

/* Estado vazio */
.feed-vazio {
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
}
.feed-vazio-icon { font-size: 48px; margin-bottom: 12px; }
.feed-vazio p { font-size: 16px; font-weight: 600; color: #9ca3af; margin-bottom: 6px; }
.feed-vazio span { font-size: 13px; color: #6b7280; }

/* Loader e sem mais */
.feed-loader {
    text-align: center;
    padding: 14px;
    color: #6b7280;
    font-size: 13px;
}
.feed-sem-mais {
    text-align: center;
    padding: 14px;
    color: #4b5563;
    font-size: 12px;
    letter-spacing: 0.3px;
}
.feed-erro {
    text-align: center;
    padding: 30px 20px;
    color: #ef4444;
    font-size: 14px;
}

/* Modal overlay */
.feed-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 10100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: fadeInModal 0.2s ease;
}
@keyframes fadeInModal { from { opacity: 0; } to { opacity: 1; } }

.feed-modal {
    background: #1e1e1e;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUpModal 0.28s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }

.feed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #f3f4f6;
    border-bottom: 1px solid #2a2a2a;
}
.feed-modal-close {
    background: #2a2a2a;
    border: none;
    color: #9ca3af;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.feed-modal-close:hover { background: #333; color: #f3f4f6; }

/* Comentários */
.feed-comentarios-lista {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.feed-sem-comentarios {
    text-align: center;
    color: #6b7280;
    font-size: 13px;
    padding: 20px;
}
.feed-comentario {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.feed-c-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2EA043, #1e7e34);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feed-c-corpo { flex: 1; min-width: 0; }
.feed-c-autor { font-size: 13px; font-weight: 700; color: #f3f4f6; margin-right: 6px; }
.feed-c-tempo { font-size: 11px; color: #6b7280; }
.feed-c-texto { font-size: 13px; color: #d1d5db; margin-top: 3px; line-height: 1.4; word-break: break-word; }
.feed-c-apagar {
    background: transparent; border: none; color: #4b5563; cursor: pointer; font-size: 12px;
    padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.feed-c-apagar:hover { color: #ef4444; }

.feed-comentario-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #2a2a2a;
}
.feed-comentario-form input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px 14px;
    color: #f3f4f6;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.feed-comentario-form input:focus { border-color: #2EA043; }
.feed-comentario-form button {
    background: #2EA043;
    border: none;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.feed-comentario-form button:disabled { opacity: 0.6; }

/* Criar post modal */
.feed-criar-modal { border-radius: 20px 20px 0 0; }
.feed-criar-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.feed-criar-body textarea {
    width: 100%;
    background: #252525;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 14px;
    color: #f3f4f6;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}
.feed-criar-body textarea:focus { border-color: #2EA043; }
.feed-criar-contador { text-align: right; font-size: 11px; color: #6b7280; margin-top: -8px; }
.feed-criar-body select {
    width: 100%;
    background: #252525;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px 14px;
    color: #f3f4f6;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.feed-criar-body select:focus { border-color: #2EA043; }

.feed-criar-imagem-area {
    background: #252525;
    border: 1px dashed #333;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
}
.feed-imagem-label {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
}
.feed-remove-img {
    display: inline-block;
    margin-top: 6px;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.feed-criar-btn {
    width: 100%;
    padding: 14px;
    background: #2EA043;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.feed-criar-btn:hover { background: #22803a; }
.feed-criar-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* FAB - botão flutuante */
.feed-fab {
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #2EA043;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(46,160,67,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.15s, box-shadow 0.15s;
    line-height: 1;
    font-family: inherit;
}
.feed-fab:active { transform: scale(0.93); }

/* Toast */
.feed-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #252525;
    color: #f3f4f6;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    pointer-events: none;
    white-space: nowrap;
}
.feed-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Modo claro */
:root:not([data-theme="dark"]) .feed-header { background: #f4f7f6; border-color: #e0e0e0; }
:root:not([data-theme="dark"]) .feed-filtro-btn { background: #e5e7eb; color: #374151; }
:root:not([data-theme="dark"]) .feed-filtro-btn.active { background: #28A745; color: #fff; }
:root:not([data-theme="dark"]) .feed-card { background: #fff; border-color: #e5e7eb; }
:root:not([data-theme="dark"]) .feed-texto { color: #374151; }
:root:not([data-theme="dark"]) .feed-autor { color: #111827; }
:root:not([data-theme="dark"]) .feed-acoes { border-color: #f3f4f6; }
:root:not([data-theme="dark"]) .feed-acoes button { color: #6b7280; }
:root:not([data-theme="dark"]) .feed-modal { background: #fff; }
:root:not([data-theme="dark"]) .feed-modal-header { color: #111827; border-color: #e5e7eb; }
:root:not([data-theme="dark"]) .feed-comentario-form { border-color: #e5e7eb; }
:root:not([data-theme="dark"]) .feed-comentario-form input { background: #f3f4f6; border-color: #e5e7eb; color: #111827; }
:root:not([data-theme="dark"]) .feed-c-autor { color: #111827; }
:root:not([data-theme="dark"]) .feed-c-texto { color: #374151; }
:root:not([data-theme="dark"]) .feed-skeleton { background: #fff; border-color: #e5e7eb; }
:root:not([data-theme="dark"]) .sk-avatar, :root:not([data-theme="dark"]) .sk-line, :root:not([data-theme="dark"]) .sk-badge, :root:not([data-theme="dark"]) .sk-body { background: #e5e7eb; }
:root:not([data-theme="dark"]) .feed-criar-body textarea, :root:not([data-theme="dark"]) .feed-criar-body select { background: #f3f4f6; border-color: #e5e7eb; color: #111827; }
:root:not([data-theme="dark"]) .feed-criar-imagem-area { background: #f3f4f6; border-color: #d1d5db; }
:root:not([data-theme="dark"]) .feed-menu-dropdown { background: #fff; border-color: #e5e7eb; }
:root:not([data-theme="dark"]) .feed-menu-dropdown button { color: #374151; }
:root:not([data-theme="dark"]) .feed-toast { background: #111827; }


/* ============================================================
   Share Sheet (partilha de posts)
   ============================================================ */
.feed-share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 99990;
    transition: background 0.28s;
}
.feed-share-overlay.open {
    background: rgba(0,0,0,0.55);
}
.feed-share-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-radius: 20px 20px 0 0;
    z-index: 99991;
    padding: 8px 0 28px;
    transition: bottom 0.3s cubic-bezier(.4,0,.2,1);
    max-height: 85vh;
    overflow-y: auto;
}
.feed-share-sheet.open {
    bottom: 0;
}
.feed-share-handle {
    width: 40px;
    height: 4px;
    background: #444;
    border-radius: 4px;
    margin: 8px auto 16px;
}
.feed-share-title {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 18px;
    letter-spacing: .3px;
}
.feed-share-networks {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 16px;
}
.feed-share-networks::-webkit-scrollbar { display: none; }
.feed-share-net {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    min-width: 64px;
    cursor: pointer;
}
.feed-share-net-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feed-share-net span:last-child {
    font-size: 11px;
    color: #d1d5db;
    font-weight: 500;
    white-space: nowrap;
}
.feed-share-net:active .feed-share-net-icon {
    opacity: 0.7;
    transform: scale(0.93);
}
.feed-share-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 12px;
}
.feed-share-action {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #252525;
    border: none;
    color: #f3f4f6;
    font-size: 14px;
    font-weight: 500;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
    width: 100%;
    font-family: inherit;
}
.feed-share-action span { font-size: 18px; }
.feed-share-action:active { background: #333; }
.feed-share-close {
    display: block;
    width: calc(100% - 24px);
    margin: 12px 12px 0;
    padding: 14px;
    background: #252525;
    border: none;
    border-radius: 12px;
    color: #e53e3e;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.feed-share-close:active { background: #333; }

/* Botão copiar texto no card */
.feed-btn-copy-text {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background .15s;
    line-height: 1;
    color: inherit;
}
.feed-btn-copy-text:active { background: rgba(255,255,255,.08); }

/* Acções de comentário */
.feed-c-acoes {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}
.feed-c-copiar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 6px;
    border-radius: 6px;
    opacity: 0.6;
    transition: opacity .15s, background .15s;
    line-height: 1;
}
.feed-c-copiar:hover, .feed-c-copiar:active { opacity: 1; background: rgba(255,255,255,.08); }

/* Modo claro — share sheet */
:root:not([data-theme="dark"]) .feed-share-sheet { background: #fff; }
:root:not([data-theme="dark"]) .feed-share-handle { background: #d1d5db; }
:root:not([data-theme="dark"]) .feed-share-title { color: #111827; }
:root:not([data-theme="dark"]) .feed-share-net span:last-child { color: #374151; }
:root:not([data-theme="dark"]) .feed-share-action { background: #f3f4f6; color: #111827; }
:root:not([data-theme="dark"]) .feed-share-action:active { background: #e5e7eb; }
:root:not([data-theme="dark"]) .feed-share-close { background: #f3f4f6; }
:root:not([data-theme="dark"]) .feed-share-close:active { background: #e5e7eb; }
