*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:     #0f0f0f;
    --surface:#1a1a1a;
    --accent: #ff6500;
    --text:   #ebebeb;
    --muted:  #888;
    --border: #2a2a2a;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 0 5%;
    border-bottom: 2px solid var(--accent);
    flex-shrink: 0;
}

#logo { font-size: 1.7em; font-weight: 900; letter-spacing: -1px; }
#logo a {
    color: #fff;
    text-decoration: none;
    display: block;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    flex-direction: unset;
    align-items: unset;
}
#logo a span  { color: var(--accent); }
#logo a:hover { color: #fff; }

#icons { display: flex; align-items: center; gap: 22px; }

a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    transition: color .2s;
}
a:hover { color: var(--accent); }
a:hover .icons { filter: brightness(0) saturate(100%) invert(45%) sepia(98%) saturate(600%) hue-rotate(2deg); }
.icons { height: 20px; width: 20px; filter: invert(1); }
.icons[alt="login"],
.icons[alt="register"] { filter: none; }
a p { font-size: 0.58em; margin-top: 3px; color: var(--muted); }

/* ── Main ── */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 28px 16px 60px;
}

.post-wrap {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Título + autor ── */
.post-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.post-titulo {
    font-size: 1.35em;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: break-word;
}

.post-autor-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-direction: row;
}

.btn-follow-sm {
    padding: 4px 14px;
    background: var(--accent);
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-follow-sm:hover { background: #ff8533; }
.btn-follow-sm.following {
    background: none;
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-follow-sm.following:hover { border-color: #e74c3c; color: #e74c3c; }
.btn-follow-sm:disabled { opacity: .6; cursor: default; }

.post-autor {
    font-size: 0.9em;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    flex-direction: row;
}
.post-autor:hover { text-decoration: underline; color: var(--accent); }

/* ── Mídia ── */
.post-wrap video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    border-radius: 6px;
}

.post-foto {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
    max-height: 80vh;
    background: #000;
}

.media-missing {
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.95em;
}

/* ── Galeria ── */
.gallery { position: relative; }

.gallery-slide        { display: none; }
.gallery-slide.active { display: block; }

.gallery-slide video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    border-radius: 6px;
}

/* ── Strip de miniaturas ── */
.gallery-strip {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.strip-btn {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 6px;
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    background: #111;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: border-color .2s;
    padding: 0;
}
.strip-btn img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.strip-btn.active { border-color: var(--accent); }
.strip-btn:hover  { border-color: #666; }
.strip-btn.active:hover { border-color: var(--accent); }

.strip-type {
    position: absolute;
    bottom: 2px;
    left: 0; right: 0;
    text-align: center;
    font-size: 0.6em;
    color: #fff;
    background: rgba(0,0,0,.55);
    padding: 1px 0;
}

.strip-icon { font-size: 1.3em; }

/* ── Meta ── */
.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--muted);
    margin-top: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.post-meta .sep { opacity: .4; }

/* ── Ações (curtir / editar) ── */
.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    text-decoration: none;
    flex-direction: row;
    transition: border-color .2s, color .2s, background .2s;
    user-select: none;
}
.like-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}
.like-btn.liked {
    background: rgba(231,76,60,.12);
    border-color: rgba(231,76,60,.5);
    color: #e74c3c;
}
.like-btn:disabled { opacity: .6; cursor: default; }

.like-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform .15s;
}
.like-btn:not(:disabled):hover .like-icon { transform: scale(1.2); }
.like-btn.liked .like-icon { transform: scale(1.1); }

.save-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    flex-direction: row;
    transition: border-color .2s, color .2s, background .2s;
    user-select: none;
}
.save-btn:hover { border-color: var(--accent); color: var(--accent); }
.save-btn.saved {
    background: rgba(255,101,0,.12);
    border-color: rgba(255,101,0,.5);
    color: var(--accent);
}
.save-btn:disabled { opacity: .6; cursor: default; }

.save-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform .15s;
}
.save-btn:not(:disabled):hover .save-icon { transform: scale(1.2); }
.save-btn.saved .save-icon { transform: scale(1.1); }

.btn-edit-post {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-direction: row;
    padding: 7px 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88em;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s, color .2s;
}
.btn-edit-post:hover { border-color: var(--accent); color: var(--accent); }

.btn-report {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    margin-left: auto;
    flex-direction: row;
    transition: border-color .2s, color .2s, background .2s;
    user-select: none;
}
.btn-report:hover:not(:disabled) { border-color: #e74c3c; color: #e74c3c; }
.btn-report.reported {
    background: rgba(231,76,60,.08);
    border-color: rgba(231,76,60,.3);
    color: rgba(231,76,60,.5);
    cursor: default;
}
.btn-report:disabled { opacity: .5; cursor: default; }
.report-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform .15s;
}
.btn-report:not(:disabled):not(.reported):hover .report-icon { transform: scale(1.15); }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-direction: row;
    padding: 7px 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88em;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s, color .2s;
    user-select: none;
}
.btn-download:hover { border-color: #4caf50; color: #4caf50; }
.dl-icon { width: 16px; height: 16px; flex-shrink: 0; transition: transform .15s; }
.btn-download:hover .dl-icon { transform: translateY(2px); }

/* ── Hashtags ── */
.post-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.tag {
    background: rgba(255,101,0,.12);
    color: var(--accent);
    border: 1px solid rgba(255,101,0,.3);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    flex-direction: row;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.tag:hover { background: rgba(255,101,0,.22); color: var(--accent); }

/* ── Comentários ── */
.comments-section {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comments-title {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-count {
    background: var(--border);
    color: var(--muted);
    font-size: 0.8em;
    font-weight: 600;
    border-radius: 12px;
    padding: 1px 8px;
}

/* Formulário de comentário */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.92em;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color .2s;
}
.comment-form textarea:focus { border-color: var(--accent); }

.comment-form button {
    align-self: flex-end;
    padding: 8px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.comment-form button:hover { background: #ff8533; }

.comment-login {
    font-size: 0.88em;
    color: var(--muted);
}
.comment-login a { color: var(--accent); flex-direction: unset; }

/* Lista de comentários */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.no-comments {
    font-size: 0.88em;
    color: var(--muted);
}

.comment-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-autor {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--accent);
}

.comment-date {
    font-size: 0.75em;
    color: var(--muted);
}

.btn-report-cmt {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    opacity: 0;
    line-height: 1;
    transition: opacity .15s, color .15s, background .15s;
}
.comment-item:hover .btn-report-cmt { opacity: 1; }
.btn-report-cmt:hover { color: #e74c3c; background: rgba(231,76,60,.1); }
.btn-report-cmt.reported { opacity: .35; cursor: default; }
.report-icon-sm {
    width: 13px;
    height: 13px;
    display: block;
}

.comment-del-form { margin-left: auto; }
.comment-del-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.75em;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s, background .15s;
}
.comment-del-btn:hover { color: #e74c3c; background: rgba(231,76,60,.1); }

.comment-texto {
    font-size: 0.9em;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Replies ── */
.btn-reply {
    background: none; border: none; color: var(--muted);
    font-size: .78em; font-weight: 600; cursor: pointer;
    padding: 2px 6px; border-radius: 4px;
    transition: color .15s; margin-left: 2px;
}
.btn-reply:hover { color: var(--accent); }
.reply-list {
    margin-top: 10px; display: flex; flex-direction: column; gap: 6px;
    padding-left: 18px; border-left: 2px solid var(--border);
}
.reply-item { background: rgba(255,255,255,.02); padding: 10px 12px; }
.reply-form-wrap { margin-top: 8px; padding-left: 18px; border-left: 2px solid var(--accent); }
.reply-form { display: flex; flex-direction: column; gap: 6px; }
.reply-textarea {
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-family: inherit; font-size: .85em;
    padding: 8px 10px; resize: vertical; min-height: 58px; width: 100%;
    transition: border-color .15s;
}
.reply-textarea:focus { outline: none; border-color: var(--accent); }
.reply-textarea::placeholder { color: var(--muted); }
.reply-actions { display: flex; gap: 8px; }
.reply-submit {
    padding: 5px 16px; background: var(--accent); color: #fff;
    border: none; border-radius: 6px; font-size: .82em; font-weight: 700;
    cursor: pointer; transition: background .15s;
}
.reply-submit:hover { background: #ff8533; }
.reply-cancel {
    padding: 5px 12px; background: none; color: var(--muted);
    border: 1px solid var(--border); border-radius: 6px;
    font-size: .82em; cursor: pointer; transition: color .15s;
}
.reply-cancel:hover { color: var(--text); }

/* ── Report modal ── */
.report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.report-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0;
    width: 100%;
    max-width: 390px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.report-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border);
}
.report-header-icon {
    width: 18px;
    height: 18px;
    color: #e74c3c;
    flex-shrink: 0;
}
.report-title {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0;
    flex: 1;
}
.report-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    font-size: 1.1em;
    transition: color .15s;
}
.report-close:hover { color: var(--text); }

.report-radios {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.report-radios label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9em;
    color: var(--text);
    cursor: pointer;
    padding: 10px 20px;
    transition: background .12s;
}
.report-radios label:hover { background: rgba(255,255,255,.04); }
.report-radios label:has(input:checked) { color: #e74c3c; background: rgba(231,76,60,.07); }
.report-radios input[type="radio"] {
    accent-color: #e74c3c;
    cursor: pointer;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.report-desc-wrap { padding: 0 20px 16px; }
.report-desc {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85em;
    padding: 10px 12px;
    resize: none;
    height: 72px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.report-desc:focus { outline: none; border-color: rgba(231,76,60,.5); }
.report-desc::placeholder { color: var(--muted); }

.report-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,.2);
}
.report-btn-cancel {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s, color .15s;
}
.report-btn-cancel:hover { border-color: #555; color: var(--text); }
.report-btn-submit {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    background: #e74c3c;
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}
.report-btn-submit:hover:not(:disabled) { opacity: .85; }
.report-btn-submit:disabled { opacity: .45; cursor: default; }

.report-msg {
    font-size: 0.82em;
    text-align: center;
    padding: 0 20px 14px;
    min-height: 0;
}
.report-msg:empty { display: none; }
.report-msg.ok  { color: #2ecc71; }
.report-msg.err { color: #e74c3c; }

/* ── Responsivo ── */
@media (max-width: 600px) {
    header { padding: 0 3%; }
    #logo  { font-size: 1.3em; }
    .icons { height: 17px; width: 17px; }
    main   { padding: 16px 10px 40px; }
    .post-titulo { font-size: 1.1em; }
}
