/* ===== VARIÁVEIS & TEMA ===== */
:root {
    --primary: #005A6E;
    --bg: #f4f7f6;
    --text: #005A6E;
    --accent: #ff4757;
    --card-bg: #fff;
    --card-shadow: rgba(0,0,0,.08);
    --border-color: #ddd;
    --whatsapp-green: #25D366;
    --comment-bg: #f0f2f5;
}
body.dark-mode {
    --primary: #00A9B5;
    --bg: #1a1a1a;
    --text: #e0e0e0;
    --accent: #ff6b7a;
    --card-bg: #2d2d2d;
    --card-shadow: rgba(0,0,0,.3);
    --border-color: #444;
    --comment-bg: #383838;
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    scroll-behavior: smooth;
    transition: background .3s, color .3s;
    padding-bottom: 80px;
    overscroll-behavior-y: contain;
}

/* ===== PULL TO REFRESH ===== */
#pull-indicator {
    position: fixed; top: -60px; left: 0; width: 100%; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; font-weight: 700;
    z-index: 1000; transition: transform .2s;
}

/* ===== HEADER ===== */
.header {
    background: var(--card-bg);
    padding: 10px 15px;
    box-shadow: 0 2px 5px var(--card-shadow);
    position: sticky; top: 0; z-index: 1100;
    transition: background .3s;
}
.title-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1000px; margin: 0 auto; gap: 10px;
}
.app-title {
    font-size: 1.5rem; font-weight: 900; color: var(--primary);
    text-align: center; flex-grow: 1; letter-spacing: -1px; user-select: none;
}
.app-title .accent { color: var(--accent); }

/* ===== HEADER AVATAR BUTTON ===== */
.header-avatar-btn {
    overflow: hidden;
}
#header-user-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    overflow: hidden;
    background: transparent;
    transition: box-shadow .2s, transform .15s;
}
/* Foto real: circular, nítida */
#header-user-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
/* Ring de foco ao hover */
.header-avatar-btn:hover #header-user-icon {
    box-shadow: 0 0 0 2.5px var(--primary);
}
/* Quando tem foto: ring colorida */
.header-avatar-btn:hover #header-user-icon img {
    box-shadow: 0 0 0 2.5px var(--primary);
}
/* Sem foto: fundo sutil para destacar o ícone 👤 */
#header-user-icon:not(:has(img)) {
    background: rgba(0, 90, 110, 0.10);
    color: var(--primary);
}
body.dark-mode #header-user-icon:not(:has(img)) {
    background: rgba(0, 169, 181, 0.15);
    color: var(--primary);
}


.menu-icon {
    font-size: 24px; cursor: pointer; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background .3s, transform .15s;
    position: relative; user-select: none;
    -webkit-tap-highlight-color: transparent; overflow: visible;
}
.menu-icon:hover { background: rgba(0,0,0,.05); }
.menu-icon:active { background: rgba(0,0,0,.1); transform: scale(.93); }
.menu-icon .notif-dot {
    position: absolute; top: 4px; right: 4px; width: 12px; height: 12px;
    background: var(--accent); border-radius: 50%; border: 2px solid var(--card-bg);
    display: none; animation: notifPulse 2s infinite;
}
@keyframes notifPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: .7; }
}

/* ===== TOP MENU ===== */
.top-menu {
    position: fixed; width: 300px; background: var(--card-bg);
    box-shadow: 0 10px 25px var(--card-shadow); z-index: 1050;
    transition: .3s; border-radius: 12px; padding: 0;
    opacity: 0; visibility: hidden; top: 60px; max-height: 80vh; overflow-y: auto;
}
.top-menu.active { opacity: 1; visibility: visible; }
.top-menu.right { right: 15px; }
.menu-list { list-style: none; padding: 0; }
.menu-list li {
    padding: 15px 20px; font-weight: 600; cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: background .2s; display: flex; align-items: center; gap: 10px;
}
.menu-list li:last-child { border-bottom: none; }
.menu-list li:hover { background: rgba(0,0,0,.03); }
.menu-section-title {
    padding: 12px 20px 8px; font-size: .85rem; color: #888;
    font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    background: var(--bg); position: sticky; top: 0; z-index: 10;
}

/* ===== CONVERSA ITEM ===== */
.conversa-item {
    padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,.05);
    cursor: pointer; transition: background .2s;
    display: flex; gap: 12px; align-items: center;
}
.conversa-item:hover { background: rgba(0,0,0,.03); }
.conversa-item:active { background: rgba(0,0,0,.06); }
.conversa-avatar {
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--whatsapp-green); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.2rem; flex-shrink: 0;
}
.conversa-info { flex-grow: 1; min-width: 0; }
.conversa-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.conversa-nome { font-weight: 600; font-size: 1rem; color: var(--text); }
.conversa-hora { font-size: .75rem; color: #999; white-space: nowrap; }
.conversa-preview { font-size: .85rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversa-badge {
    background: var(--whatsapp-green); color: #fff; border-radius: 50%;
    min-width: 22px; height: 22px; display: flex; align-items: center;
    justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; padding: 0 5px;
}
.conversa-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* ===== OVERLAY & MODAL ===== */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.4); display: none; z-index: 1040;
}
.overlay.active { display: block; }
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.5); display: none; align-items: center;
    justify-content: center; z-index: 2000; padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--card-bg); border-radius: 15px; padding: 25px;
    max-width: 500px; width: 100%; max-height: 80vh; overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--border-color);
}
.modal-header h2 { font-size: 1.3rem; color: var(--primary); }
.close-modal {
    font-size: 28px; cursor: pointer; color: #999;
    width: 35px; height: 35px; display: flex; align-items: center;
    justify-content: center; border-radius: 50%; transition: background .2s;
}
.close-modal:hover { background: rgba(0,0,0,.05); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text); }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px 15px; border: 1px solid var(--border-color);
    border-radius: 8px; background: var(--bg); color: var(--text);
    font-size: 1rem; outline: none; transition: border-color .3s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.btn-primary {
    background: var(--primary); color: #fff; border: none;
    padding: 12px 25px; border-radius: 25px; cursor: pointer;
    font-weight: 700; font-size: 1rem; width: 100%; transition: opacity .3s;
}
.btn-primary:hover { opacity: .9; }

/* ===== LAYOUT ===== */
.container { max-width: 800px; margin: 0 auto; padding: 15px; }
.hidden-input { display: none; }
.empty-state { text-align: center; padding: 40px 20px; color: #888; }
.empty-state-icon { font-size: 3rem; margin-bottom: 15px; }

/* ===== POST ===== */
.post {
    background: var(--card-bg); border-radius: 15px; overflow: hidden;
    box-shadow: 0 4px 15px var(--card-shadow); margin-bottom: 20px;
    position: relative; animation: fadeInUp .3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.post.news-post { border-left: 4px solid #ffc107; }
.post-header {
    display: flex; align-items: center; gap: 12px;
    padding: 15px; border-bottom: 1px solid var(--border-color);
}
.post-avatar {
    width: 45px; height: 45px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.2rem; flex-shrink: 0; overflow: hidden;
}
.post-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.post-info { flex-grow: 1; }
.post-author { font-weight: 700; color: var(--text); }
.post-time { font-size: .85rem; color: #888; }
.post-content { padding: 15px; }
.post-text { color: var(--text); font-size: 1rem; line-height: 1.6; margin-bottom: 10px; white-space: pre-wrap; }
.post-image {
    width: 100%; max-height: 400px; object-fit: cover;
    border-radius: 8px; margin-top: 10px; cursor: pointer; transition: transform .2s;
}
.post-image:hover { transform: scale(1.01); }
.post-link {
    display: inline-block; color: var(--primary); text-decoration: none;
    font-weight: 700; margin-top: 10px;
}
.post-link:hover { text-decoration: underline; }

/* ===== ENGAGEMENT BAR ===== */
.engagement-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 15px; font-size: .8rem; color: #888;
}
.engagement-left { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.engagement-right { display: flex; gap: 10px; align-items: center; }
.engagement-right span { cursor: pointer; }
.engagement-right span:hover { text-decoration: underline; }
.reaction-chip {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--comment-bg); border-radius: 12px;
    padding: 2px 8px; font-size: .8rem;
}

/* ===== POST ACTIONS ===== */
.post-actions {
    display: flex; align-items: stretch;
    padding: 0; border-top: 1px solid var(--border-color);
}
.action-btn {
    background: transparent; border: none; border-right: 1px solid var(--border-color);
    padding: 10px 12px; cursor: pointer; font-size: .88rem; color: #666;
    display: flex; align-items: center; justify-content: center;
    gap: 5px; transition: all .15s; position: relative;
    flex: 1; white-space: nowrap; min-width: 0;
}
.action-btn:last-child { border-right: none; }
.action-btn:hover { background: rgba(0,0,0,.03); color: var(--text); }
.action-btn:active { transform: scale(.95); }
.action-btn.liked { color: var(--accent); font-weight: 600; }
.action-btn .act-icon { font-size: 1.1rem; line-height: 1; }
.action-btn .act-label { font-size: .78rem; font-weight: 500; }

/* ===== REACT AREA (inline) ===== */
.react-area {
    display: flex; align-items: stretch;
    border-right: 1px solid var(--border-color); flex-shrink: 0; overflow: hidden;
}
.react-plus-btn {
    background: transparent; border: none; padding: 10px 12px; cursor: pointer;
    display: flex; align-items: center; gap: 4px; color: #666;
    transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.react-plus-btn:hover { background: rgba(0,0,0,.03); color: var(--primary); }
.react-plus-btn:active { transform: scale(.95); }
.react-plus-btn.has-reaction { color: var(--accent); font-weight: 700; }
.plus-icon { font-size: 1.1rem; line-height: 1; transition: transform .2s; }
.plus-count { font-size: .72rem; font-weight: 700; color: #999; line-height: 1; }
.react-plus-btn.open .plus-icon { transform: rotate(45deg); }

/* Emojis inline — deslizam na mesma linha */
.reactions-inline {
    display: flex; align-items: center;
    max-width: 0; overflow: hidden;
    transition: max-width .32s cubic-bezier(.34,1.3,.64,1), opacity .2s;
    opacity: 0; gap: 1px; flex-shrink: 0;
}
.reactions-inline.show { max-width: 230px; opacity: 1; }
.reaction-option {
    font-size: 1.35rem; cursor: pointer; padding: 4px 5px;
    border-radius: 50%; transition: transform .15s, background .15s;
    border: none; background: transparent; line-height: 1; flex-shrink: 0;
}
.reaction-option:hover { transform: scale(1.4); background: rgba(0,0,0,.06); }
.reaction-option.active { background: rgba(0,90,110,.12); transform: scale(1.15); }

/* ===== REACTIONS BREAKDOWN POPUP ===== */
.reactions-breakdown {
    position: absolute; bottom: calc(100% + 8px); left: 0;
    background: var(--card-bg); border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05);
    padding: 10px 14px; display: none; z-index: 200; min-width: 130px;
}
.reactions-breakdown.show { display: block; animation: bdPopIn .2s ease; }
@keyframes bdPopIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.breakdown-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .85rem; }
.breakdown-name { flex-grow: 1; color: #888; font-size: .8rem; }
.breakdown-count { font-weight: 800; color: var(--text); }

@keyframes popIn {
    from { opacity: 0; transform: translateX(-50%) scale(.7) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

/* ===== SHARE POPUP ===== */
.share-popup {
    position: absolute; bottom: calc(100% + 8px); right: 0;
    background: var(--card-bg); border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.05);
    padding: 8px; display: none; z-index: 200; min-width: 170px;
}
.share-popup.show { display: block; animation: bdPopIn .2s ease; }
.share-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    font-size: .9rem; font-weight: 600; color: var(--text);
    transition: background .15s; border: none; background: transparent;
    width: 100%; text-align: left;
}
.share-option:hover { background: var(--comment-bg); }
.share-icon { font-size: 1.3rem; width: 28px; text-align: center; flex-shrink: 0; }

/* ===== COMMENTS ===== */
.comments-section {
    border-top: 1px solid var(--border-color);
    max-height: 0; overflow: hidden; transition: max-height .4s ease;
}
.comments-section.open { max-height: 2000px; }
.comments-list { padding: 10px 15px; }
.comment-item {
    display: flex; gap: 10px; margin-bottom: 12px; animation: fadeInUp .2s ease;
}
.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem; flex-shrink: 0; overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-body { flex-grow: 1; }
.comment-bubble {
    background: var(--comment-bg); border-radius: 12px;
    padding: 8px 12px; display: inline-block; max-width: 100%;
}
.comment-author { font-weight: 700; font-size: .85rem; color: var(--text); }
.comment-text { font-size: .9rem; color: var(--text); word-wrap: break-word; }
.comment-time { font-size: .7rem; color: #999; margin-top: 3px; padding-left: 4px; }
.comment-input-area {
    display: flex; gap: 8px; padding: 10px 15px;
    border-top: 1px solid var(--border-color); align-items: center;
}
.comment-input-area input {
    flex-grow: 1; padding: 8px 14px; border: 1px solid var(--border-color);
    border-radius: 20px; background: var(--comment-bg); color: var(--text);
    outline: none; font-size: .9rem;
}
.comment-input-area input:focus { border-color: var(--primary); }
.comment-send-btn {
    background: var(--primary); color: #fff; border: none;
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    font-size: 1rem; display: flex; align-items: center; justify-content: center;
    transition: opacity .2s; flex-shrink: 0;
}
.comment-send-btn:hover { opacity: .85; }

/* ===== NEWS BADGE ===== */
.news-badge {
    background: #ffc107; color: #000; padding: 3px 8px;
    border-radius: 8px; font-size: .7rem; font-weight: 700; margin-left: 8px;
}

/* ===== IMAGE UPLOAD ===== */
.image-preview-container { position: relative; display: none; margin-top: 10px; }
.image-preview-container img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; }
.image-preview-remove {
    position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6);
    color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px;
    cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.image-upload-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg); border: 1px dashed var(--border-color);
    padding: 10px 16px; border-radius: 10px; cursor: pointer;
    color: var(--text); font-size: .9rem; transition: border-color .3s;
}
.image-upload-btn:hover { border-color: var(--primary); }

/* ===== FOOTER ===== */
.footer {
    background: var(--card-bg); padding: 12px 15px;
    position: fixed; bottom: 0; width: 100%;
    box-shadow: 0 -2px 15px var(--card-shadow); z-index: 1100;
}
.footer-inner { max-width: 800px; margin: 0 auto; }

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.9); display: none; align-items: center;
    justify-content: center; z-index: 3000; cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 95%; max-height: 95%; object-fit: contain; border-radius: 8px; }

/* ===== NOTIFICATIONS PANEL ===== */
.notif-panel {
    position: fixed; width: 320px; background: var(--card-bg);
    box-shadow: 0 10px 25px var(--card-shadow); z-index: 1050;
    border-radius: 12px; padding: 0; opacity: 0; visibility: hidden;
    top: 60px; left: 15px; max-height: 60vh; overflow-y: auto; transition: .3s;
}
.notif-panel.active { opacity: 1; visibility: visible; }
.notif-panel-header {
    padding: 15px 20px; font-weight: 700; font-size: 1rem; color: var(--text);
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; background: var(--card-bg); z-index: 10;
}
.notif-clear-btn {
    font-size: .8rem; color: var(--primary); cursor: pointer;
    font-weight: 600; border: none; background: none;
}
.notif-clear-btn:hover { text-decoration: underline; }
.notif-item {
    padding: 12px 20px; border-bottom: 1px solid rgba(0,0,0,.04);
    display: flex; gap: 10px; align-items: flex-start;
    cursor: pointer; transition: background .2s;
}
.notif-item:hover { background: rgba(0,0,0,.03); }
.notif-item.unread { background: rgba(0,90,110,.04); }
.notif-icon { font-size: 1.3rem; flex-shrink: 0; }
.notif-content { flex-grow: 1; min-width: 0; }
.notif-text { font-size: .9rem; color: var(--text); line-height: 1.3; }
.notif-time { font-size: .75rem; color: #999; margin-top: 2px; }
.notif-empty { padding: 30px 20px; text-align: center; color: #999; font-size: .9rem; }

/* ===== INFINITE SCROLL ===== */
#scroll-loader { text-align: center; padding: 20px; color: #888; font-size: .9rem; display: none; }
#scroll-loader.visible { display: block; }
#no-more-posts { text-align: center; padding: 12px; color: #bbb; font-size: .8rem; display: none; }
#no-more-posts.visible { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .top-menu { width: 90%; max-width: 350px; }
    .notif-panel { width: 90%; max-width: 350px; left: 5%; }
    .action-btn { padding: 9px 8px; }
    .action-btn .act-label { font-size: .7rem; }
    .react-plus-btn { padding: 9px 8px; }
    .reaction-option { font-size: 1.2rem; padding: 3px 4px; }
    .reactions-inline.show { max-width: 210px; }
}

/* ===== MÍDIA — GRAVAÇÃO E PLAYERS ===== */

/* --- Modal: seção de mídia --- */
.media-form-group { border: 1px solid var(--border-color); border-radius: 12px; padding: 14px; background: var(--bg); }
.media-form-group label { display: block; margin-bottom: 10px; font-weight: 600; }

.media-type-btns {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.media-type-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--card-bg); border: 1.5px solid var(--border-color);
    border-radius: 22px; padding: 9px 16px; cursor: pointer;
    font-size: .88rem; font-weight: 600; color: var(--text);
    transition: border-color .2s, background .2s, transform .1s;
    flex: 1; min-width: 130px; justify-content: center;
}
.media-type-btn:hover { border-color: var(--primary); background: rgba(0,90,110,.05); }
.media-type-btn:active { transform: scale(.97); }
.media-btn-icon { font-size: 1.3rem; }

.media-file-row { display: flex; margin-top: 4px; }
.media-file-btn {
    display: inline-flex; align-items: center; gap: 7px;
    background: transparent; border: 1.5px dashed var(--border-color);
    border-radius: 22px; padding: 9px 16px; cursor: pointer;
    font-size: .85rem; font-weight: 500; color: #888;
    transition: border-color .2s, color .2s; width: 100%; justify-content: center;
}
.media-file-btn:hover { border-color: var(--primary); color: var(--primary); }

/* --- Gravação ativa --- */
.recording-ui {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 16px; background: rgba(255,71,87,.06); border-radius: 12px;
    border: 1.5px solid rgba(255,71,87,.2); animation: fadeInUp .25s ease;
}
.recording-status {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; color: var(--text); font-size: .92rem;
}
.rec-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #ff4757; flex-shrink: 0;
    animation: recPulse 1s ease-in-out infinite;
}
@keyframes recPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: .6; }
}
.rec-timer {
    font-variant-numeric: tabular-nums; font-weight: 800;
    font-size: 1.1rem; color: #ff4757; letter-spacing: .5px;
    font-family: 'Courier New', monospace;
}
.rec-stop-btn {
    background: #ff4757; color: #fff; border: none;
    padding: 10px 28px; border-radius: 22px; cursor: pointer;
    font-weight: 700; font-size: .92rem; transition: opacity .2s, transform .1s;
    display: flex; align-items: center; gap: 6px;
}
.rec-stop-btn:hover { opacity: .88; }
.rec-stop-btn:active { transform: scale(.96); }

/* --- Preview mídia no modal --- */
.media-preview-wrapper {
    border: 1.5px solid var(--border-color); border-radius: 12px;
    padding: 12px; background: var(--card-bg); animation: fadeInUp .25s ease;
}
.media-preview-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.media-remove-btn {
    background: none; border: 1px solid var(--border-color); border-radius: 20px;
    padding: 4px 12px; cursor: pointer; font-size: .78rem; font-weight: 600;
    color: #888; transition: background .2s, color .2s;
}
.media-remove-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Audio player no feed --- */
.audio-player-wrap {
    background: linear-gradient(135deg, var(--primary) 0%, #007a8e 100%);
    border-radius: 14px; padding: 14px 16px; margin-top: 10px;
}
.audio-player-info {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.audio-icon { font-size: 1.6rem; flex-shrink: 0; }
.audio-label { color: rgba(255,255,255,.9); font-size: .88rem; font-weight: 600; }
.post-audio {
    width: 100%; height: 36px;
    border-radius: 20px; outline: none;
    accent-color: #fff;
    filter: invert(1) brightness(1.2);
}
.post-audio::-webkit-media-controls-panel { background: rgba(255,255,255,.15); border-radius: 18px; }

/* --- Video player no feed --- */
.media-container { margin-top: 8px; }
.post-video {
    width: 100%; max-height: 340px; border-radius: 12px;
    object-fit: cover; background: #000; display: block;
    cursor: pointer;
}
.post-video:focus { outline: 2px solid var(--primary); }

/* Mídia não encontrada */
.media-missing {
    display: block; text-align: center; padding: 16px; color: #999;
    font-size: .85rem; background: var(--bg); border-radius: 10px;
    margin-top: 8px;
}

/* Dark mode ajustes */
body.dark-mode .audio-player-wrap {
    background: linear-gradient(135deg, #007a8e 0%, #005A6E 100%);
}
body.dark-mode .post-audio {
    filter: invert(0) brightness(1);
    accent-color: var(--primary);
}

/* ===== GRAVAÇÃO — MELHORIAS STEP 5 ===== */

/* Barra de progresso de tempo */
.rec-progress-wrap {
    width: 100%; height: 4px; background: rgba(255,255,255,.2);
    border-radius: 4px; overflow: hidden; margin-top: 2px;
}
.rec-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #4caf50, #ffc107, #ff4757);
    border-radius: 4px; transition: width 1s linear;
}

/* Hint de drag & drop */
.media-drop-hint {
    font-size: .75rem; color: #aaa; align-self: center;
    margin-left: 8px; white-space: nowrap;
}
.media-file-row { align-items: center; }

/* Drop zone ativa */
.media-form-group.drag-over {
    border-color: var(--primary);
    background: rgba(0,90,110,.06);
    box-shadow: 0 0 0 3px rgba(0,90,110,.15);
}
.media-form-group {
    transition: border-color .2s, background .2s, box-shadow .2s;
    border: 2px dashed var(--border-color);
}

/* Canvas do visualizador */
#audio-level-canvas {
    width: 100%;
    height: 48px;
    border-radius: 8px;
}

/* ===== SERVER / PUBLIC POSTS ===== */
.post.server-post { border-left: 4px solid #00b4d8; }

.server-badge {
    display: inline-flex; align-items: center; gap: 3px;
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: #fff; padding: 2px 8px; border-radius: 10px;
    font-size: .68rem; font-weight: 700; margin-left: 6px;
    vertical-align: middle; letter-spacing: .3px;
    box-shadow: 0 1px 4px rgba(0,119,182,.3);
}
.server-badge.own {
    background: linear-gradient(135deg, #7b2ff7, #4776e6);
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative; display: inline-block;
    width: 46px; height: 26px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc; border-radius: 26px;
    transition: .3s;
}
.toggle-slider:before {
    position: absolute; content: '';
    height: 20px; width: 20px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .3s;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: .5; cursor: not-allowed; }

/* Animação do badge de novos posts */
@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Status dot de conexão no header */
#nav-notif-dot {
    transition: background .5s ease;
}

/* Indicador de post sincronizado em grupo */
.server-sync-icon {
    font-size: .75rem;
    color: var(--primary);
    opacity: .7;
    margin-left: 4px;
}
