:root {
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --text-muted: #6c757d;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --ad-bg: #e2e3e5;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary-color: #3794ff;
    --secondary-color: #a0a0a0;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --ad-bg: #2d2d2d;
}

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

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Header & Navigation */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 1.5rem;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 4px;
    background: transparent;
    position: absolute;
    bottom: 0;
    left: 0;
}

.progress-bar {
    height: 4px;
    background: var(--primary-color);
    width: 0%;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Article Styles */
.post {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.post-header {
    margin-bottom: 2rem;
}

.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-featured-image-container {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-featured-image {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.post-featured-image:hover {
    transform: scale(1.01);
}

.post-image-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: bold;
}

.post-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.post-content h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.5rem;
}

.post-content p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.post-content ul {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
    font-size: 1.1rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.disclaimer {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin-bottom: 2rem;
    font-style: italic;
    color: var(--text-muted);
}

.warning-box {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

/* Sidebar & Ads */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.widget h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.ad-placeholder {
    width: 100%;
    min-height: 250px;
    background-color: var(--ad-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px dashed var(--secondary-color);
    text-align: center;
    padding: 1rem;
}

/* Footer */
footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Contact Form & Form Elements */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 650px;
    margin-top: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group label span {
    color: #dc3545;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    align-self: flex-start;
}

.btn-submit:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Status Notifications / Alerts */
.form-status {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    display: none;
    line-height: 1.5;
}

.form-status.show {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.form-status.success {
    background-color: rgba(40, 167, 69, 0.12);
    border-left: 4px solid #28a745;
    color: #1e7e34;
}

[data-theme="dark"] .form-status.success {
    color: #5dd879;
}

.form-status.error {
    background-color: rgba(220, 53, 69, 0.12);
    border-left: 4px solid #dc3545;
    color: #bd2130;
}

[data-theme="dark"] .form-status.error {
    color: #ff6b7d;
}

.form-status.info {
    background-color: rgba(0, 123, 255, 0.12);
    border-left: 4px solid var(--primary-color);
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* History / Dudas enviadas */
.doubts-history-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.doubts-history-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doubt-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.doubt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.doubt-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.doubt-category {
    background-color: rgba(0, 123, 255, 0.15);
    color: var(--primary-color);
}

.doubt-subject {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.3rem;
    font-size: 1.05rem;
}

.doubt-body {
    color: var(--text-color);
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none; /* In a real app, add a hamburger menu */
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
