@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00246b;
    --secondary-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Install page generic layout */
.install-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
    max-width: 500px;
    width: 100%;
}

.install-header {
    background: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

.install-body {
    padding: 30px;
}

/* Desktop Styles */
@media (min-width: 992px) {
    body {
        font-size: 0.9vw;
    }
    
    h1 { font-size: 1vw; font-weight: 600; }
    h2 { font-size: 1.2vw; font-weight: 600; }
    h3 { font-size: 1.3vw; font-weight: 500; }
    h4 { font-size: 1.1vw; font-weight: 500; }
    h5 { font-size: 1.1vw; font-weight: 500; }
    h6 { font-size: 1.1vw; font-weight: 500; }
    
    .btn {
        font-size: 0.8vw;
        padding: 0.5vw 1vw;
        border-radius: 0.3vw;
    }
    
    .form-control {
        font-size: 0.8vw;
        padding: 0.5vw;
        border-radius: 0.3vw;
    }
    
    .card {
        border-radius: 0.5vw;
        box-shadow: var(--shadow);
    }
    
    .card-body {
        padding: 1vw;
    }
}

/* Mobile Styles */
@media (max-width: 991px) {
    body {
        font-size: 4vw;
    }
    
    h1 { font-size: 5vw; font-weight: 600; }
    h2 { font-size: 4.5vw; font-weight: 600; }
    h3 { font-size: 4vw; font-weight: 500; }
    h4 { font-size: 3.5vw; font-weight: 500; }
    h5 { font-size: 3vw; font-weight: 500; }
    h6 { font-size: 2.5vw; font-weight: 500; }
    
    .btn {
        font-size: 4vw;
        padding: 2vw 4vw;
        border-radius: 1vw;
    }
    
    .form-control {
        font-size: 4vw;
        padding: 2vw;
        border-radius: 1vw;
    }
    
    .card {
        border-radius: 2vw;
        box-shadow: var(--shadow);
    }
    
    .card-body {
        padding: 4vw;
    }
}

/* Primary Button */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #001a4f;
    border-color: #001a4f;
    transform: translateY(-2px);
}

.btn-success-custom {
    background-color: #458507;
    border-color: #458507;
    color: white;
    transition: all 0.3s ease;
}

.btn-success-custom:hover {
    background-color: #3a6f06;
    border-color: #3a6f06;
    color: white;
    transform: translateY(-2px);
}

/* Custom Classes */
.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.text-primary-custom {
    color: var(--primary-color) !important;
}

.border-primary-custom {
    border-color: var(--primary-color) !important;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
}

.login-card {
    background: var(--white);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Dashboard */
.sidebar {
    background-color: var(--primary-color);
    min-height: 100vh;
    color: var(--white);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

.main-content {
    background-color: var(--light-color);
    min-height: 100vh;
    
}

/* Increase spacing between sidebar and main content */
.container-fluid > .row { 
    --bs-gutter-x: 2.5rem;
}

.sidebar + .main-content {
    padding-left: 2rem;
}

/* Force stronger left/right padding for main content next to sidebar */
.container-fluid > .row > .main-content {
    padding-left: 2.5rem !important;
    padding-right: 2.5rem !important;
}

@media (max-width: 991.98px) {
    .container-fluid > .row { 
        --bs-gutter-x: 1rem;
    }
    .container-fluid > .row > .main-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Cards */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: var(--white);
    border: none;
}

.stats-card .card-body {
    text-align: center;
}

/* Tables */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
}

.table td {
    vertical-align: middle;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-upload-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    cursor: pointer;
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    background-color: #001a4f;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}



/* Ajuste para search results no main content */
.main-content .input-group {
    position: relative;
}

.main-content .input-group-text {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.main-content .input-group .form-control {
    border-left: none;
}

.main-content .input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 36, 107, 0.25);
}

.search-result-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--light-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Main content search results */
.main-content .search-results {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.main-content .search-result-item {
    color: #333;
}

.main-content .search-result-item:hover {
    background-color: var(--light-color);
}

/* Sidebar search results adjustments (para outras páginas que ainda usem) */
.sidebar .search-results {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.sidebar .search-result-item {
    color: #333;
}

.sidebar .search-result-item:hover {
    background-color: rgba(0, 36, 107, 0.1);
}

/* Utilities */
.text-truncate-custom {
    display: -webkit-box;

    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-custom {
    box-shadow: var(--shadow);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .navbar-toggler {
        display: block;
    }
}

/* Publicações - Novos estilos */
.publication-card {
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.publication-card:hover {
    box-shadow: 0 4px 12px rgba(0, 36, 107, 0.15);
    border-color: #00246b;
}

.publication-content {
    line-height: 1.7;
    font-size: 1.1rem;
}

.publication-content .content-wrapper {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Novo estilo para conteúdo simples */
.publication-content-simple {
    line-height: 1.6;
    font-size: 1rem;
    color: #333;
}

.publication-content h1, 
.publication-content h2, 
.publication-content h3, 
.publication-content h4, 
.publication-content h5, 
.publication-content h6,
.publication-content-simple h1, 
.publication-content-simple h2, 
.publication-content-simple h3, 
.publication-content-simple h4, 
.publication-content-simple h5, 
.publication-content-simple h6 {
    color: #00246b;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.publication-content h1:first-child,
.publication-content h2:first-child,
.publication-content h3:first-child,
.publication-content h4:first-child,
.publication-content h5:first-child,
.publication-content h6:first-child,
.publication-content-simple h1:first-child,
.publication-content-simple h2:first-child,
.publication-content-simple h3:first-child,
.publication-content-simple h4:first-child,
.publication-content-simple h5:first-child,
.publication-content-simple h6:first-child {
    margin-top: 0;
}

.publication-content p,
.publication-content-simple p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.publication-content ul, 
.publication-content ol,
.publication-content-simple ul, 
.publication-content-simple ol {
    margin-bottom: 1.2rem;
    padding-left: 2rem;
}

.publication-content li,
.publication-content-simple li {
    margin-bottom: 0.5rem;
}

.publication-content blockquote,
.publication-content-simple blockquote {
    border-left: 4px solid #458507;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6c757d;
    background: rgba(69, 133, 7, 0.05);
    border-radius: 0.25rem;
}

.publication-content img,
.publication-content-simple img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Utility icon sizes/colors extracted from inline styles */
.icon-xl { font-size: 3rem; color: #ccc; }
.icon-lg { font-size: 2.5rem; }
.icon-md { font-size: 2rem; }
.icon-primary { color: #0d6efd; }
.icon-success { color: #198754; }
.icon-secondary { color: #6c757d; }

.logo-80 { max-height: 80px; }
.maxh-100 { max-height: 100px; }
.overflow-y-300 { max-height: 300px; overflow-y: auto; }

.publication-content table,
.publication-content-simple table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.publication-content table th,
.publication-content table td,
.publication-content-simple table th,
.publication-content-simple table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.publication-content table th,
.publication-content-simple table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.publication-content table tr:nth-child(even),
.publication-content-simple table tr:nth-child(even) {
    background-color: rgba(0, 36, 107, 0.02);
}

/* Melhorias no breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Cards de documentos */
.document-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef !important;
}

.document-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 36, 107, 0.15);
    border-color: var(--primary-color) !important;
}

.document-icon-wrapper i {
    transition: all 0.3s ease;
}

.document-card:hover .document-icon-wrapper i {
    transform: scale(1.1);
    color: var(--primary-color) !important;
}

/* Melhorias nos links da logo */
.sidebar a:hover img {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.sidebar a:hover h6 {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Botão de voltar */
.btn-outline-dark {
    border-width: 2px;
    font-weight: 500;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
}

.btn-outline-dark:hover {
    background-color: #212529;
    border-color: #212529;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 37, 41, 0.2);
}

.btn-dark {
    font-weight: 500;
    padding: 0.75rem 2rem;
    transition: all 0.3s ease;
}

.btn-dark:hover {
    background-color: #1c1f23;
    border-color: #1c1f23;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 37, 41, 0.3);
}

/* Estilos para CKEditor */
.ck-editor__editable {
    min-height: 300px;
    max-height: 500px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.ck-editor__editable:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 36, 107, 0.25) !important;
}

.ck.ck-toolbar {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    border-color: #ced4da;
}

.ck.ck-editor__main > .ck-editor__editable {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-color: #ced4da;
    border-top: none;
}

.ck.ck-button {
    font-family: 'Poppins', sans-serif;
}

.ck.ck-button:hover {
    background-color: rgba(0, 36, 107, 0.1);
}

.ck.ck-button.ck-on {
    background-color: var(--primary-color);
    color: white;
}

.ck.ck-button.ck-on:hover {
    background-color: rgba(0, 36, 107, 0.8);
}

/* Estilos para conteúdo do CKEditor renderizado */
.publication-content .ck-content,
.publication-content-simple .ck-content {
    font-family: 'Poppins', sans-serif;
}

.publication-content .ck-content h1,
.publication-content .ck-content h2,
.publication-content .ck-content h3,
.publication-content .ck-content h4,
.publication-content .ck-content h5,
.publication-content .ck-content h6,
.publication-content-simple .ck-content h1,
.publication-content-simple .ck-content h2,
.publication-content-simple .ck-content h3,
.publication-content-simple .ck-content h4,
.publication-content-simple .ck-content h5,
.publication-content-simple .ck-content h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.publication-content .ck-content figure.media,
.publication-content-simple .ck-content figure.media {
    margin: 1.5rem 0;
    text-align: center;
}

.publication-content .ck-content figure.media iframe,
.publication-content-simple .ck-content figure.media iframe {
    max-width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.publication-content .ck-content .table,
.publication-content-simple .ck-content .table {
    margin: 1.5rem 0;
    width: 100%;
}

.publication-content .ck-content .table table,
.publication-content-simple .ck-content .table table {
    border-collapse: collapse;
    width: 100%;
}

.publication-content .ck-content .table td,
.publication-content .ck-content .table th,
.publication-content-simple .ck-content .table td,
.publication-content-simple .ck-content .table th {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.publication-content .ck-content .table th,
.publication-content-simple .ck-content .table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Responsividade para CKEditor */
@media (max-width: 768px) {
    .ck-editor__editable {
        min-height: 250px;
        font-size: 16px;
    }
    
    .ck.ck-toolbar {
        flex-wrap: wrap;
    }
    
    .ck.ck-toolbar .ck-toolbar__items {
        flex-wrap: wrap;
    }
} 