* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
}

header {
    background: url("imagens/banner.png") center/cover no-repeat;
    height: 240px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.logo {
    position: absolute;
    top: 20px;
    left: 30px;
    height: 70px;
    z-index: 2;
}

header h1 {
    position: relative;
    color: white;
    font-size: 2.8rem;
    z-index: 2;
    text-align: center;
}

nav {
    position: absolute;
    top: 25px;
    right: 40px;
    z-index: 2;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    transition: 0.3s;
    font-size: 0.95rem;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.25);
}

.active-link {
    background: rgba(255, 255, 255, 0.3);
}

header.shrink {
    height: 180px;
    transition: 0.3s ease;
}

main {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 2rem;
}

section.create-post,
section.posts-section {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.composer {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.composer-avatar {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #4CAF50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.composer-fields {
    flex: 1;
    min-width: 0;
}

.create-post input,
.create-post textarea,
.create-post button {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
    padding: 10px;
    border: 1px solid #ccc;
    font-family: inherit;
    box-sizing: border-box;
}

.create-post textarea {
    min-height: 100px;
    resize: vertical;
}

.create-post input:focus,
.create-post textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: #888;
    margin-top: -10px;
    margin-bottom: 12px;
}

.char-counter.over-limit {
    color: #e53935;
    font-weight: 600;
}

.composer-extras {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.composer-extras .file-label {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    transition: background-color 0.2s, border-color 0.2s;
    margin-bottom: 15px;
}

.composer-extras .file-label:hover {
    background-color: #f0f7f0;
    border-color: #4CAF50;
}

.composer-extras input[type="text"] {
    flex: 1;
    min-width: 180px;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: -10px;
    margin-bottom: 8px;
}

.file-name {
    display: block;
    font-size: 0.8rem;
    color: #4CAF50;
    margin-top: -6px;
    margin-bottom: 12px;
}

.file-name.over-limit {
    color: #e53935;
    font-weight: 600;
}

.create-post button#createPost {
    background-color: #4CAF50;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s, transform 0.1s;
}

.create-post button#createPost:hover {
    background-color: #45a049;
}

.create-post button#createPost:active {
    transform: scale(0.99);
}

.create-post button#createPost:disabled {
    background-color: #9bcf9d;
    cursor: not-allowed;
}

.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.sort-controls {
    display: flex;
    gap: 8px;
}

.sort-btn {
    background: #f0f2f5;
    border: 1px solid #e0e0e0;
    color: #555;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.sort-btn:hover {
    background: #e4f2e5;
}

.sort-btn.active {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
}

.search-input {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag-filter {
    background: #eef3ff;
    border: 1px solid #d5e2ff;
    color: #3b5bdb;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.tag-filter:hover {
    transform: translateY(-1px);
}

.tag-filter.active {
    background: #3b5bdb;
    color: #fff;
    border-color: #3b5bdb;
}

.posts-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s, transform 0.15s;
}

.post-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.avatar.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

.post-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-author {
    font-weight: 700;
    color: #222;
    font-size: 0.95rem;
}

.post-time {
    font-size: 0.78rem;
    color: #888;
}

.post-topic-tag {
    color: #4CAF50;
    font-weight: 600;
}

.delete-post-btn,
.delete-comment-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.delete-post-btn:hover,
.delete-comment-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.post-title {
    margin-top: 0;
    margin-bottom: 8px;
}

.post-content {
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.post-card .tags span,
.post-card .tag-pill {
    background-color: #4CAF50;
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 5px;
    font-size: 0.8rem;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 6px;
}

.post-card .tags span:hover {
    background-color: #3d8b40;
}

.post-card img.post-image {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    border-radius: 8px;
    display: block;
}

.post-card iframe {
    width: 100%;
    height: 300px;
    margin-top: 10px;
    border-radius: 8px;
    border: none;
}

.video-link {
    display: inline-block;
    margin-top: 10px;
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
}

.video-link:hover {
    text-decoration: underline;
}

.post-card .interactions {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.post-card .like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f0f2f5;
    color: #333;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s, transform 0.15s;
}

.post-card .like-btn:hover {
    background-color: #ffe4e4;
}

.post-card .like-btn.liked {
    background-color: #ffe4e4;
    color: #e53935;
}

.post-card .like-btn:active .heart {
    transform: scale(1.3);
}

.post-card .like-btn .heart {
    display: inline-block;
    transition: transform 0.15s ease;
}

.comment-count {
    color: #777;
    font-size: 0.85rem;
}

.comment-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.comment-form .comment-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 14px;
}

.comment-form .comment-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.post-card .comment-btn {
    background-color: #FF9800;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.post-card .comment-btn:hover {
    background-color: #F57C00;
}

.skeleton {
    pointer-events: none;
}

.skeleton-block {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    margin-top: 10px;
    width: 100%;
}

.skeleton-line.short {
    width: 40%;
    height: 10px;
    margin-top: 0;
}

.skeleton-line.shorter {
    width: 25%;
    height: 8px;
}

.skeleton-line.wide {
    width: 70%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #777;
}

.empty-emoji {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.empty-sub {
    font-size: 0.9rem;
    color: #999;
    margin-top: 4px;
}

footer {
    background-color: #111;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer a {
    color: #4ea8ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
.comments-container {
    margin-top: 15px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background-color: #f1f1f1;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-body strong {
    color: #4CAF50;
    display: block;
    font-size: 0.85rem;
}

.comment-body p {
    margin-top: 2px;
    word-wrap: break-word;
}

@media (max-width: 900px) {

    header {
        height: auto;
        padding: 2rem 1rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    header::after {
        border-radius: 0;
    }

    .logo {
        position: static;
        height: 55px;
        margin-bottom: 1rem;
    }

    header h1 {
        font-size: 2rem;
        margin: 0.5rem 0;
    }

    nav {
        position: static;
        margin-top: 1rem;
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }

    nav a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .composer {
        flex-direction: column;
    }

    .composer-avatar {
        margin: 0 auto;
    }

    .posts-header {
        flex-direction: column;
        align-items: flex-start;
    }
}