:root {
    --bg: #ffffff;
    --bg-light: #f2f2f2;
    --primary: #1abc9c;
    --secondary: #2c3e50;
    --text: #111111;
    --muted: #555555;
    --border: #dddddd;
    --radius: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f1724 0%, #1a202c 100%);
    color: var(--text);
    line-height: 1.6;
    scroll-behavior: smooth;
    min-height: 100vh;
}

body.high-contrast {
    --bg: #ffffff;
    --bg-light: #ffffff;
    --primary: #000000;
    --secondary: #000000;
    --text: #000000;
    --muted: #000000;
    --border: #000000;
    background: #ffffff !important;
}

body.high-contrast .main-header {
    background-color: #ffffff !important;
    border: 3px solid #000000 !important;
}

body.high-contrast .menu a {
    color: #000000 !important;
    font-weight: 900 !important;
    text-decoration: underline !important;
}

body.high-contrast .menu a:hover,
body.high-contrast .menu a.active {
    color: #000000 !important;
    border-bottom: 4px solid #000000 !important;
}

body.high-contrast .post {
    border: 3px solid #000000 !important;
    background: #ffffff !important;
}

body.high-contrast .tag {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
}

body.dark-mode {
    --bg: #121212;
    --bg-light: #1e1e1e;
    --primary: #80cbc4;
    --secondary: #bb86fc;
    --text: #ffffff;
    --muted: #aaaaaa;
    --border: #333333;
    background: linear-gradient(135deg, #0a0a0a 0%, #121212 100%);
}

body.dark-mode .main-header {
    background-color: #1e1e1e;
    border-bottom-color: #80cbc4;
}

body.dark-mode .menu a {
    color: #ffffff;
}

body.dark-mode .menu a:hover,
body.dark-mode .menu a.active {
    color: #80cbc4;
    border-bottom-color: #80cbc4;
}

body.dyslexia-friendly {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', 'Century Gothic', sans-serif;
    letter-spacing: 0.1em;
    line-height: 1.8;
}

body.dyslexia-friendly * {
    letter-spacing: 0.05em;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body.reduced-motion * {
    animation: none !important;
    transition: none !important;
}

body.large-text {
    font-size: 18px;
}

body.large-text .menu a {
    font-size: 1.1rem;
    padding: 10px 15px;
}

body.large-text .forum-hero h1 {
    font-size: 3.5rem;
}

body.large-text .forum-hero p {
    font-size: 1.3rem;
}

body.large-text .post h3 {
    font-size: 1.5rem;
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--primary) !important;
    outline-offset: 2px !important;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
}

.main-header {
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
}

.logo {
    width: 100px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.menu {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.menu a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    position: relative;
    padding-bottom: 4px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.menu a:hover,
.menu a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--text);
}

#user-area {
    margin-left: 10px;
}

#user-area .btn {
    background: var(--primary);
    color: #000;
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
}

#user-area .btn:hover {
    background: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
}

.forum-hero {
    text-align: center;
    padding: 4rem 1rem;
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.1), rgba(0, 0, 0, 0));
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.forum-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(26, 188, 156, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.forum-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), #3498db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forum-hero p {
    color: var(--muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.forum-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.forum-actions input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg-light);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
    min-width: 0;
}

.forum-actions input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2);
}

.forum-actions button {
    padding: 1rem 2rem;
    border-radius: var(--radius);
    border: none;
    background: var(--primary);
    color: #000;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.forum-actions button:hover {
    background: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
}

.forum-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

#inicio {
    grid-column: 1;
}

#novo-topico {
    grid-column: 2;
    grid-row: 1;
}

#topicos {
    grid-column: 2;
    grid-row: 1;
    visibility: hidden;
    color: #0f172400;
}

#trends {
    grid-column: 2;
    grid-row: 3;
}

#inicio h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.post:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(26, 188, 156, 0.15);
}

.post h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.post small {
    color: var(--muted);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1rem;
}

.post p {
    margin: 1rem 0;
    line-height: 1.6;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.post-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.post-actions {
    display: flex;
    gap: 0.8rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.post-actions button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0..3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.post-actions button:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

#novo-topico {
    position: sticky;
    top: 100px;
    height: fit-content;
}

#novo-topico h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

#form-topico {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#form-topico input,
#form-topico textarea,
#form-topico select {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

#form-topico input:focus,
#form-topico textarea:focus,
#form-topico select:focus {
    outline: none;
    border-color: var(--primary);
}

#form-topico textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

#form-topico button[type="submit"] {
    background: var(--primary);
    color: #000;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

#form-topico button[type="submit"]:hover {
    background: #16a085;
}

.nova-categoria {
    display: flex;
    gap: 0.5rem;
}

.nova-categoria input {
    flex: 1;
}

.nova-categoria button {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nova-categoria button:hover {
    background: rgba(26, 188, 156, 0.1);
}

#topicos h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.categorias {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.categorias li {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.categorias li:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateX(5px);
}

#trends h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.trends {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.trends li {
    background: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.trends li:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: var(--bg-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-content textarea {
    width: 100%;
    height: 150px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 600;
}

#cancelarComentario {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

#publicarComentario {
    background: var(--primary);
    color: #000;
}

#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

#scrollTopBtn.show {
    display: flex;
}

#scrollTopBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(26, 188, 156, 0.4);
}

.forum-like-btn.liked {
    background: var(--primary) !important;
    color: #000 !important;
    border-color: var(--primary) !important;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

footer {
    background-color: #0077cc;
    color: #fff;
    padding: 40px 20px;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.footer-section {
    min-width: 200px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-section ul li a:hover {
    color: #e0f2ff;
    transform: translateX(3px);
}

footer .copyright {
    font-size: 14px;
    color: #f0f0f0;
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

@media (max-width: 900px) {
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 20px;
        background: var(--bg-light);
        padding: 1rem;
        border-radius: var(--radius);
        z-index: 2000;
    }

    .menu.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .post-actions {
        flex-direction: column;
    }

    .post-actions button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
    }
}

@media (max-width: 1024px) {
    .forum-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    #inicio,
    #novo-topico,
    #topicos,
    #trends {
        grid-column: 1;
    }

    #novo-topico {
        position: static;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-wrap: wrap;
    }

    .menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
        margin-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .menu.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .forum-hero h1 {
        font-size: 2rem;
    }

    .forum-hero p {
        font-size: 1rem;
    }

    .forum-actions {
        flex-direction: column;
    }

    .forum-actions button {
        width: 100%;
    }

    .post-actions {
        flex-wrap: wrap;
    }

    .post-actions button {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .categorias {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 10px 15px;
    }

    .logo {
        width: 80px;
    }

    .forum-hero {
        padding: 2rem 1rem;
    }

    .post {
        padding: 1rem;
    }

    .post-actions button {
        min-width: 100px;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1rem;
    }
}