/* C:\xampp\htdocs\artigos\css\style.css */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --bg-color: #f4f7f6;
    --text-color: #333;
    --white: #ffffff;
    --border-color: #ddd;
    --card-bg: #ffffff;
    --header-bg: #2c3e50;
}

body.dark-theme {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --white: #2c2c2c;
    --border-color: #444;
    --card-bg: #2d2d2d;
    --header-bg: #121212;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: filter 0.3s;
}

a:hover {
    filter: brightness(1.2);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--header-bg);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
}

header a:hover {
    filter: none;
    opacity: 0.8;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.3s;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff !important;
}

.btn-primary:hover {
    filter: brightness(0.9);
}

.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border-top: 4px solid var(--accent-color);
}

.nav-tab.active {
    background-color: var(--accent-color) !important;
    color: white !important;
}

form div {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--white);
    color: var(--text-color);
}

/* Estilos do Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.sent {
    align-self: flex-end;
    background-color: var(--accent-color);
    color: white;
    border-bottom-right-radius: 2px;
}

.message.received {
    align-self: flex-start;
    background-color: #e9e9eb;
    color: #333;
    border-bottom-left-radius: 2px;
}

.message .meta {
    display: block;
    font-size: 0.7rem;
    margin-bottom: 4px;
    font-weight: bold;
    opacity: 0.8;
}

.message .time {
    display: block;
    font-size: 0.65rem;
    margin-top: 5px;
    text-align: right;
    opacity: 0.7;
}

.chat-input-area {
    padding: 15px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex-grow: 1;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 10px 20px;
    outline: none;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: var(--accent-color);
}

#btn-send-chat {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
}

.section-content, .secao-preview, .ql-editor {
    text-align: justify;
    text-justify: inter-word;
}

/* Figuras Acadêmicas */
.figura-academica {
    margin: 25px auto;
    display: table;
    text-align: center;
    max-width: 100%;
}

.figura-academica .legenda-topo {
    display: block;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-align: center;
}

.figura-academica img {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
}

.figura-academica .fonte-rodape {
    display: block;
    font-size: 0.8rem;
    color: #555;
    margin-top: 8px;
    text-align: center;
}

footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 40px;
    color: #777;
}

/* Ajustes para o editor no tema escuro */
body.dark-theme .ql-toolbar {
    background-color: #eee;
}
body.dark-theme .ql-container {
    background-color: #fff;
    color: #333; /* Mantemos o editor claro por padrão para melhor escrita, ou podemos escurecer também */
}
