/* ========================================
   MALTA ADVOCACIA - COMUNICADOS INTERNOS
   CSS Unificado com SIDA (Sem Emojis)
======================================== */

/* ========================================
   VARIÁVEIS DE COR (CONSISTENTE COM SIDA)
======================================== */
:root {
    /* Cores Bootstrap */
    --bs-primary-rgb: 13, 110, 253;
    --bs-success-rgb: 25, 135, 84;
    --bs-gray-100: #f8f9fa;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-600: #6c757d;
    --bs-gray-800: #495057;
    --bs-gray-900: #212529;

    /* Cores customizadas para fila */
    --fila-gray: #6c757d;
    --fila-gray-light: #adb5bd;
    --fila-gray-dark: #495057;
    --fila-accent: #00b347;
    --fila-accent-dark: #009639;

    /* Gradiente principal (consistente com SIDA) */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ========================================
   BASE E TIPOGRAFIA (CONSISTENTE COM SIDA)
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #f7f8fc;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* ========================================
   TELAS E NAVEGAÇÃO (CONSISTENTE COM SIDA)
======================================== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   TELA DE LOADING
======================================== */
/* Estilos movidos para seção principal mais abaixo no arquivo */

/* ========================================
   TELA DE LOGIN
======================================== */
.login-container {
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    margin: 0 auto;
}

.login-card .text-center {
    margin-bottom: 1.5rem;
}

.login-card .alert {
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
}

.login-card .mb-4 {
    margin-bottom: 1rem !important;
}

.login-card .form-control-lg {
    padding: 0.6rem 0.875rem;
}

.login-card .form-label {
    margin-bottom: 0.4rem;
}

/* Estilo específico para campos de login */
.login-card .form-control-lg {
    padding: 0.75rem 0.875rem;
    border: 2px solid #e2e8f0 !important;
    font-size: 0.875rem !important; /* Diminui o tamanho da fonte */
}

/* Botão de login com mesma espessura dos inputs */
.login-card .btn-lg {
    padding: 0.75rem 0.875rem !important;
    border: 2px solid #0d6efd !important;
    font-size: 0.875rem !important;
}

/* Link de redefinir senha */
#resetPasswordLink {
    color: #0d6efd;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

#resetPasswordLink:hover {
    color: #0a58ca;
}

/* Botão de excluir */
.btn-delete {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-delete:hover {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* ========================================
   NAVBAR (CONSISTENTE COM SIDA)
======================================== */
.navbar {
    background: #212529 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    max-height: 75px;
    overflow: hidden;
}

.navbar .container,
.navbar .container-fluid {
    max-height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar .d-flex.justify-content-between.align-items-center.w-100 {
    align-items: center;
}

.btn-outline-light {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    color: white !important;
}

/* ========================================
   NAVEGAÇÃO ENTRE TELAS (REMOVIDO - USANDO MODAL)
======================================== */

/* ========================================
   TELA DE LOGIN (REMOVIDO - USANDO MODAL)
======================================== */

/* ========================================
   INPUTS E FORMS (CONSISTENTE COM SIDA)
======================================== */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.875rem;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px !important;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

/* Sobrescrever estilos do Bootstrap que possam interferir */
.input-group input:not([type="checkbox"]):not([type="radio"]),
.input-group select,
.input-group textarea,
.form-control {
    border-radius: 8px !important;
    border: 2px solid #e2e8f0 !important;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Mensagem de erro no login */
.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    display: none;
}

/* ========================================
   BOTÕES (CONSISTENTE COM SIDA)
======================================== */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
    border-width: 1px !important;
    line-height: 1.4 !important;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
}

.btn-primary:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

.btn-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.btn-secondary:hover {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
}

.btn-outline-light {
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    border-width: 2px !important;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    color: white !important;
}

.btn-sm {
    padding: 0.25rem 0.75rem !important;
    font-size: 0.8125rem !important;
}

/* ========================================
   NAVBAR (CONSISTENTE COM SIDA)
======================================== */
.navbar {
    background: #212529 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: none;
    max-height: 75px;
    overflow: hidden;
}

.navbar .container,
.navbar .container-fluid {
    max-height: 75px;
    display: flex;
    align-items: center;
}

.navbar.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.navbar {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Permitir estilos inline para tamanhos de fonte personalizados */
.navbar .h4[style*="font-size"] {
    font-weight: 700 !important;
}

.navbar small[style*="font-size"] {
    opacity: 0.6 !important;
}

/* Para elementos sem estilos inline, usar valores padrão */
.navbar .h4:not([style*="font-size"]) {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
}

.navbar small:not([style*="font-size"]) {
    font-size: 0.8rem !important;
    opacity: 0.6 !important;
}

.btn-outline-light {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   TELA PRINCIPAL (CONSISTENTE COM SIDA)
======================================== */
#mainScreen {
    background-color: #f7f8fc;
    min-height: 100vh;
}

.container {
    padding: 1.5rem;
}

main.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* ========================================
   SEÇÃO DE COMUNICADOS
======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.section-header h2 {
    color: var(--bs-gray-900);
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.announcements-list {
    display: grid;
    gap: 20px;
}

/* ========================================
   MODAL DE PESQUISA
======================================== */
.search-content {
    padding: 0;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Melhor organização dos filtros no modal de pesquisa */
.search-content .filter-row:first-of-type {
    grid-template-columns: 1.2fr 0.8fr;
}

.search-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.search-actions .btn {
    flex: 0 0 auto;
    min-width: 100px;
}

.search-results {
    max-height: 450px;
    overflow-y: auto;
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

.search-result-item {
    padding: 1.25rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-result-item:hover {
    background: #f8f9fa;
    border-color: #0d6efd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-result-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.search-result-preview {
    color: #4a5568;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.search-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}

/* ========================================
   MODAL DE PERGUNTA
======================================== */
.question-content {
    padding: 0;
}

.question-content h4 {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

/* ========================================
   CARDS DE COMUNICADOS COM AÇÕES MELHORADAS
======================================== */
.announcement-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid #f1f3f4;
    gap: 1rem;
}

.primary-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.secondary-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Botões flat principais */
.btn-flat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #ffffff;
    color: #495057;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-flat:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
}

.btn-flat:active {
    transform: translateY(0);
}

.btn-flat i {
    font-size: 0.875rem;
}

/* Botões de ícone secundários */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    background: #ffffff;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
}

.btn-icon:active {
    transform: translateY(0);
}

/* Estados específicos dos botões */
.btn-acknowledge {
    border-color: #28a745;
    color: #28a745;
}

.btn-acknowledge:hover {
    background: #28a745;
    color: white;
}

.btn-acknowledge.acknowledged {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-acknowledge.acknowledged:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}

.btn-question {
    border-color: #ffc107;
    color: #856404;
}

.btn-question:hover {
    background: #ffc107;
    color: #212529;
}

.btn-interactions {
    border-color: #17a2b8;
    color: #0c5460;
}

.btn-interactions:hover {
    background: #17a2b8;
    color: white;
}

.btn-edit {
    border-color: #0d6efd;
    color: #0d6efd;
}

.btn-edit:hover {
    background: #0d6efd;
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   CARDS DE COMUNICADOS (DESIGN SIDA)
======================================== */
.announcement-card {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    margin-bottom: 1.25rem;
    transition: box-shadow 0.2s ease;
}

.announcement-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

.announcement-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.announcement-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.priority-normal {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.priority-important {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.priority-urgent {
    background: #fecaca;
    color: #b91c1c;
    border: 1px solid #ef4444;
}

.announcement-content {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.announcement-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.announcement-content img:hover {
    transform: scale(1.02);
}

.announcement-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.announcement-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f3f4;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-interactions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-acknowledged,
.meta-questions {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.meta-acknowledged:hover,
.meta-questions:hover {
    background: #f8f9fa;
    color: #495057;
}

.meta-acknowledged.has-content,
.meta-questions.has-content {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.meta-acknowledged.has-content:hover {
    background: #bbdefb;
    color: #0d47a1;
}

.meta-questions.has-content:hover {
    background: #fff3e0;
    color: #ef6c00;
}

.meta-separator {
    color: #dee2e6;
    margin: 0 0.25rem;
}

/* ========================================
   MODAIS DE DETALHES DE INTERAÇÕES
======================================== */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    backdrop-filter: blur(4px);
}

.detail-modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
}

.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.detail-modal-header h4 {
    color: #4a5568;
    font-size: 1.1rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.detail-modal-close:hover {
    color: #495057;
    background: #f8f9fa;
}

.acknowledged-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.acknowledged-user {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

.acknowledged-user i {
    color: #28a745;
    margin-right: 0.5rem;
}

.questions-list-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-detail-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #ffc107;
}

.question-author {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-text {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.question-date {
    font-size: 0.75rem;
    color: #adb5bd;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* ========================================
   BOTÕES DE AÇÃO DOS COMUNICADOS (REMOVIDOS - USANDO FLAT DESIGN)
======================================== */
/* Estilos movidos para seção anterior com novo design flat */

/* ========================================
   MODAIS (CONSISTENTE COM SIDA)
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Garantir que os input groups dentro do modal ocupem toda a largura */
.modal-content .input-group,
.modal-content .editor-container {
    width: 100%;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    color: #4a5568;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #495057;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* ========================================
   EDITOR DE TEXTO RICO
======================================== */
.rich-editor {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.rich-editor:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.editor-toolbar {
    background: #f8f9fa;
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid #d0d7de;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.editor-btn:hover {
    background: #f3f4f6;
}

.editor-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.editor-content {
    min-height: 150px;
    padding: 0.75rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ========================================
   EDITOR QUILL.JS
======================================== */
.input-group .ql-container {
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.input-group .ql-editor {
    min-height: 150px;
    padding: 0.75rem;
    line-height: 1.5;
}

.input-group .ql-toolbar {
    border: none;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.input-group .ql-snow {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.input-group .ql-snow:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.input-group .ql-toolbar .ql-picker {
    color: #4a5568;
}

.input-group .ql-toolbar .ql-stroke {
    stroke: #4a5568;
}

.input-group .ql-toolbar .ql-fill {
    fill: #4a5568;
}

.input-group .ql-toolbar button:hover {
    color: #0d6efd;
}

.input-group .ql-toolbar button:hover .ql-stroke {
    stroke: #0d6efd;
}

.input-group .ql-toolbar button:hover .ql-fill {
    fill: #0d6efd;
}

.input-group .ql-toolbar .ql-active {
    color: #0d6efd;
}

.input-group .ql-toolbar .ql-active .ql-stroke {
    stroke: #0d6efd;
}

.input-group .ql-toolbar .ql-active .ql-fill {
    fill: #0d6efd;
}

/* ========================================
   UPLOAD DE IMAGENS MELHORADO
======================================== */
.image-upload-area {
    border: 2px dashed #d0d7de;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    background: #f8f9fa;
    margin: 0.5rem 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: #0d6efd;
    background: #f0f7ff;
}

.image-upload-area.dragover {
    border-color: #0d6efd;
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.upload-text {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.file-input {
    display: none;
}

.upload-btn {
    background: #0d6efd;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.upload-btn:hover {
    background: #0b5ed7;
}

.uploaded-images {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.uploaded-image {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.uploaded-image:hover {
    transform: scale(1.05);
}

.uploaded-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: block;
}

.remove-image {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.remove-image:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* ========================================
   EXIBIÇÃO DE IMAGENS NOS COMUNICADOS
======================================== */
.announcement-images {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.announcement-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.announcement-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Modal para visualizar imagem em tamanho completo */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.image-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   EDITOR DE TEXTO SIMPLES
======================================== */
.editor-container {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    width: 100%;
    margin: 0;
}

.editor-container:focus-within {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.editor-toolbar {
    background: #f8f9fa;
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.editor-btn {
    padding: 0.375rem 0.5rem;
    border: 1px solid #d0d7de;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #495057;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.editor-btn:hover {
    background: #f3f4f6;
    border-color: #0d6efd;
}

.editor-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.editor-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.editor-content {
    min-height: 150px;
    max-height: 300px;
    padding: 0.75rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    width: 100%;
    box-sizing: border-box;
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: #6c757d;
    pointer-events: none;
}

.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
    border: 1px solid #e9ecef;
}

/* Estilização de títulos dentro do editor e dos comunicados */
.editor-content h1,
.announcement-content h1 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 0.5rem 0;
    color: #2d3748;
}

.editor-content h2,
.announcement-content h2 {
    font-size: 1.3rem;
    line-height: 1.35;
    margin: 0.5rem 0;
    color: #2d3748;
}

/* ========================================
   TELA DE LOADING
======================================== */
#loadingScreen.active {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f7f8fc;
}

.loading-container {
    text-align: center;
    color: #4a5568;
    max-width: 400px;
    width: 100%;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container h3 {
    color: #212529;
    font-size: 1.75rem;
    margin-bottom: 15px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.loading-container p {
    color: #6c757d;
    font-size: 1.125rem;
    margin: 0;
    font-weight: 400;
}

/* ========================================
   TELA DE LOGIN (CONSISTENTE COM SIDA)
======================================== */

/* ========================================
   RESPONSIVIDADE PARA MOBILE
======================================== */
@media (max-width: 768px) {
    .announcement-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .primary-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .secondary-actions {
        justify-content: center;
        gap: 1rem;
    }

    .btn-flat {
        justify-content: center;
        width: 100%;
    }
      .btn-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-actions {
        justify-content: center;
    }

    .announcement-meta {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .meta-interactions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .btn-flat span {
        font-size: 0.8rem;
    }

    .primary-actions {
        gap: 0.4rem;
    }

    .secondary-actions {
        gap: 0.75rem;
    }

    .announcement-card {
        padding: 1rem;
    }

    .announcement-actions {
        padding: 0.5rem 0;
    }
}

/* ========================================
   MODAL DE FAVORITOS E ÍNDICE GERAL
======================================== */
.favorites-content,
.index-content {
    max-height: 70vh;
    overflow-y: auto;
}

.favorites-list,
.index-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.favorite-item,
.index-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.favorite-item:hover,
.index-item:hover {
    background: #f8f9fa;
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorite-item-content,
.index-item-content {
    flex: 1;
}

.favorite-item-title,
.index-item-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.favorite-item-meta,
.index-item-meta {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.favorite-item-actions,
.index-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-remove-favorite {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-remove-favorite:hover {
    background: #c82333;
}

.index-filters {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    align-items: end;
}

/* Melhor layout para os filtros do índice em modal mais estreito */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

.index-stats {
    background: #e3f2fd;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    color: #1976d2;
    font-weight: 500;
}

.empty-favorites,
.empty-index {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-favorites i,
.empty-index i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-favorites h4,
.empty-index h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

/* ========================================
   MODAL DE INTERAÇÕES MELHORADO
======================================== */
.interactions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

.interactions-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
}

.interactions-content h3 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.interactions-content h4 {
    margin: 0 0 2rem 0;
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 500;
    font-style: italic;
}

.interactions-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

.interactions-section h5 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.acknowledged-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.user-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid #bbdefb;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.question-item strong {
    color: #2d3748;
    display: block;
    margin-bottom: 0.5rem;
}

.question-item p {
    color: #4a5568;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.question-item small {
    color: #718096;
    font-size: 0.75rem;
}

.interactions-section:empty + .interactions-section {
    margin-top: 0;
}

/* Botão fechar do modal de interações */
.interactions-content .btn {
    margin-top: 1.5rem;
    background: #6c757d;
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.interactions-content .btn:hover {
    background: #5a6268;
}

/* ========================================
   CORREÇÃO DE CORES DOS ÍCONES
======================================== */

.btn-icon.favorited {
    color: #ffc107;
}

.btn-icon.favorited:hover {
    color: #e0a800;
}

/* Padronizar cores dos botões do header */
#searchAnnouncementsBtn,
#favoritesBtn,
#indexBtn {
    background: transparent !important;
    border: 1px solid #0d6efd !important;
    color: #0d6efd !important;
    font-weight: 500 !important;
}

#searchAnnouncementsBtn:hover,
#favoritesBtn:hover,
#indexBtn:hover {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

/* ========================================
   BOTÕES OUTLINE PRIMÁRIOS MELHORADOS
======================================== */
.btn-outline-primary {
    background: transparent !important;
    border: 1px solid #0d6efd !important;
    color: #0d6efd !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-outline-primary:hover {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.btn-outline-primary:focus {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-outline-primary:active {
    background: #0b5ed7 !important;
    border-color: #0a58ca !important;
    color: white !important;
    transform: translateY(0);
}

/* ========================================
   FIM DO CSS UNIFICADO COM SIDA
======================================== */

/* ========================================
   SISTEMA DE RESPOSTAS A PERGUNTAS
======================================== */

/* Modal de resposta */
#responseModal .modal-content {
    max-width: 600px;
}

.response-content {
    padding: 1rem 0;
}

.original-question {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.original-question-content strong {
    color: #495057;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

.original-question-content p {
    color: #212529;
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
    font-weight: 500;
}

.original-question-content small {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Lista de respostas */
.responses-list {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #e9ecef;
}

.response-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.response-item:last-child {
    margin-bottom: 0;
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.response-header strong {
    color: #495057;
    font-size: 0.875rem;
}

.response-header strong i {
    color: #6c757d;
    margin-right: 0.25rem;
}

.response-header small {
    color: #6c757d;
    font-size: 0.75rem;
}

.response-text {
    color: #212529;
    margin: 0;
    line-height: 1.5;
    font-size: 0.875rem;
}

/* Botões de resposta */
.btn-response,
.btn-response-detail {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-response:hover,
.btn-response-detail:hover {
    background: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.btn-response:active,
.btn-response-detail:active {
    background: #1e7e34;
    border-color: #1c7430;
    transform: translateY(0);
}

/* Seção de respostas na lista detalhada */
.responses-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.responses-section h6 {
    color: #495057;
    font-size: 0.875rem;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.response-detail-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.response-detail-item:last-child {
    margin-bottom: 0;
}

.response-header-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.response-header-detail strong {
    color: #495057;
    font-size: 0.875rem;
}

.response-header-detail small {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Melhorias na estrutura de perguntas */
.question-header,
.question-header-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.question-header strong,
.question-header-detail strong {
    color: #495057;
}

.question-header small,
.question-header-detail small {
    color: #6c757d;
    font-size: 0.75rem;
}

.question-text {
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

/* Responsividade para o sistema de respostas */
@media (max-width: 768px) {
    .responses-list {
        padding-left: 0.5rem;
        border-left-width: 2px;
    }
    
    .response-item,
    .response-detail-item {
        padding: 0.5rem;
    }
    
    .responses-section {
        padding: 0.75rem;
    }
    
    .btn-response,
    .btn-response-detail {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* Estados de hover para melhor UX */
.question-item:hover .btn-response {
    background: #20c997;
    border-color: #20c997;
}

.question-detail-item:hover .btn-response-detail {
    background: #20c997;
    border-color: #20c997;
}

/* Indicador visual para perguntas com respostas */
.question-item.has-responses {
    border-left: 3px solid #28a745;
}

.question-detail-item.has-responses {
    border-left: 3px solid #28a745;
}

/* ========================================
   FIM DO SISTEMA DE RESPOSTAS
======================================== */
