
:root {
    --bs-primary: #212121;
    --bs-primary-rgb: 33, 33, 33;
    --navbar-bg-color: #15387e;
    --hero-bg-color-light: #f8f9fa;
    --hero-bg-color-dark: #495057;
    --card-bg-color-light: #ffffff;
    --card-bg-color-dark: #343a40;
    --card-border-light: #dee2e6;
    --card-border-dark: #495057;
    --text-color-light: #212529;
    --text-color-dark: #e9ecef;
    --muted-text-color-light: #6c757d;
    --muted-text-color-dark: #adb5bd;
    --input-bg-color-light: #f1f3f5;
    --input-bg-color-dark: #454d55;
    --input-color-light: #212529;
    --input-color-dark: #ffffff;
    --input-border-light: #ced4da;
    --input-border-dark: #6c757d;
    --search-icon-color-light: #6c757d;
    --search-icon-color-dark: #adb5bd;
    --category-btn-bg-light: #f1f3f5;
    --category-btn-bg-dark: #495057;
    --category-btn-text-light: #212529;
    --category-btn-text-dark: #e9ecef;
    --alert-danger-bg-light: #f8d7da;
    --alert-danger-bg-dark: #721c24;
    --alert-danger-text-light: #721c24;
    --alert-danger-text-dark: #f5c6cb;
    --alert-success-bg-light: #d4edda;
    --alert-success-bg-dark: #155724;
    --alert-success-text-light: #155724;
    --alert-success-text-dark: #c3e6cb;
    --alert-info-bg-light: #d1ecf1;
    --alert-info-bg-dark: #17a2b8;
    --alert-info-text-light: #0c5460;
    --alert-info-text-dark: #ffffff;
    --pdf-button-color: #f70031;
    --body-bg-light: #f8f9fa;
    --body-bg-dark: #212529;
    --link-color-light: #007bff;
    --link-color-dark: #7e7e7e;
    --navbar-height: 90px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 72px;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--body-bg-light);
    color: var(--text-color-light);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body.dark {
    background-color: var(--body-bg-dark);
    color: var(--text-color-dark);
}

/* Navbar */
.navbar-custom {
    background-color: var(--navbar-bg-color) !important;
    padding: 1.6rem 0;
    z-index: 1030;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: #fff !important;
    display: flex;
    align-items: center;
    padding-bottom: inherit;
}

.navbar-brand .logo-img {
    max-height: 30px;
    width: auto;
    margin-right: 10px;
    border-radius: 5px;
}

.navbar-nav .nav-link {
    color: #fff !important;
    margin-right: 15px;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.2s ease;
}

.navbar-nav .nav-link:hover {
    color: #e9ecef !important;
    transform: translateY(-2px);
}

.navbar-toggler {
    border: none;
    background-color: transparent;
    outline: none;
    box-shadow: none !important;
    color: white;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Sidebar */
#sidebarMenu {
    background-color: var(--navbar-bg-color);
    transition: all 0.4s ease-in-out;
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    width: var(--sidebar-width);
    will-change: width, transform;
}

#sidebarMenu.collapsed {
    width: var(--sidebar-collapsed-width);
}

#sidebarMenu .nav-link {
    color: #fff;
    border-radius: 15px;
    padding: 12px;
    margin: 2px;
    display: flex;
    align-items: center;
}

#sidebarMenu .nav-link i {
    margin-right: 10px;
    font-size: 1.2rem;
}

#sidebarMenu.collapsed .nav-link i {
    margin-right: 0;
}

#sidebarMenu .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

#sidebarMenu .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-bg {
    background-color: rgba(
        21, 56, 126, 0.90    ) !important;
}

#sidebarMenu.collapsed .sidebar-text,
#sidebarMenu.collapsed .sidebar-title {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#sidebarMenu:not(.collapsed) .sidebar-text,
#sidebarMenu:not(.collapsed) .sidebar-title {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.sidebar-title {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1 0 auto;
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.4s ease-in-out, width 0.4s ease-in-out;
    box-sizing: border-box;
    will-change: margin-left, width;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

.main-content-wrapper {
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 15px;
    box-sizing: border-box;
    padding-top: 120px;
}

.main-content-container {
    width: 100%;
    max-width: 100%;
    padding: 6rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background-color: var(--card-bg-color-light);
    animation: fadeIn 0.6s ease-out;
    border: 1px solid var(--card-border-light);
}

body.dark .main-content-container {
    background-color: var(--card-bg-color-dark);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border-dark);
}

/* Footer */
footer {
    flex-shrink: 0;
    padding: 1.5rem 0;
    background-color: #f8f9fa;
    color: #6c757d;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark footer {
    background-color: var(--card-bg-color-dark);
    color: var(--muted-text-color-dark);
}

/* Buttons */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #0d0d0d;
    --bs-btn-hover-border-color: #080808;
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #030303;
    --bs-btn-active-border-color: #000000;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0 1px var(--bs-btn-hover-border-color);
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--bs-primary) 85%, black);
    border-color: color-mix(in srgb, var(--bs-primary) 85%, black);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background-color: var(--pdf-button-color);
    border-color: var(--pdf-button-color);
    color: #fff;
}

.btn-success:hover {
    background-color: color-mix(in srgb, var(--pdf-button-color) 85%, black);
    border-color: color-mix(in srgb, var(--pdf-button-color) 85%, black);
}

.btn-check:checked+.btn, .btn.active, .btn.show, .btn:first-child:active, :not(.btn-check)+.btn:active {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active {
    color: #fff !important;
    border: none;
    border-radius: 4px;
    background: none !important;
}

/* Cards */
.card {
    border-radius: 10px;
    border: 1px solid var(--card-border-light);
    margin-bottom: 1.5rem;
    background-color: var(--card-bg-color-light);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body.dark .card {
    background-color: var(--card-bg-color-dark);
    border: 1px solid var(--card-border-dark);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.card-title {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

body.dark .card-title {
    color: var(--text-color-dark);
}

/* Article Cards */
.article-card {
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: var(--card-bg-color-light);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: cardFadeIn 0.5s ease-in;
    animation-fill-mode: both;
    min-height: 400px; /* Altura mínima para consistência */
    height: 100%; /* Garante que todos os cards tenham a mesma altura na linha */
    display: flex;
    flex-direction: column;
}

body.dark .article-card {
    background-color: var(--card-bg-color-dark);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px var(--bs-card-border-color);
}

.article-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem; /* Padding consistente */
}

.article-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color-light);
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 3rem; /* Altura mínima para títulos */
}

body.dark .article-card .card-title {
    color: var(--text-color-dark);
}

.article-card .card-text {
    color: var(--muted-text-color-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1rem;
    flex-grow: 1; /* Faz o texto ocupar o espaço disponível */
}

body.dark .article-card .card-text {
    color: var(--muted-text-color-dark);
}

.article-card .button-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.article-card .btn {
    flex: 1; /* Faz os botões ocuparem o mesmo espaço */
    text-align: center;
    padding: 0.5rem; /* Padding uniforme */
    font-size: 0.9rem; /* Tamanho de fonte consistente */
}

.article-card .btn-primary,
.article-card .btn-outline-pdf {
    min-width: 120px; /* Largura mínima para consistência */
    height: 40px; /* Altura fixa para alinhamento */
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-card .btn-outline-pdf {
    border-radius: 10px;
    border: 1px solid var(--pdf-button-color);
    color: var(--pdf-button-color);
    transition: background-color 0.3s, transform 0.2s;
}

.article-card .btn-outline-pdf:hover {
    background-color: var(--pdf-button-color);
    color: #ffffff;
    transform: translateY(-2px);
}

.article-card .btn-icon {
    gap: 5px;
}

.article-card .card-footer {
    background-color: transparent;
    border-top: 1px solid var(--card-border-light);
    padding: 0.75rem 1.5rem;
    margin-top: auto; /* Alinha ao final do card */
}

body.dark .article-card .card-footer {
    border-top: 1px solid var(--card-border-dark);
}

.article-card .text-muted {
    font-size: 0.85rem;
    color: var(--muted-text-color-light) !important;
    line-height: 1.4; /* Espaçamento uniforme */
}

body.dark .article-card .text-muted {
    color: var(--muted-text-color-dark) !important;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.article-card:nth-child(1) { animation-delay: 0.1s; }
.article-card:nth-child(2) { animation-delay: 0.2s; }
.article-card:nth-child(3) { animation-delay: 0.3s; }
.article-card:nth-child(4) { animation-delay: 0.4s; }
.article-card:nth-child(5) { animation-delay: 0.5s; }
.article-card:nth-child(6) { animation-delay: 0.6s; }

/* Forms */
.form-control, .form-select, .tox-tinymce {
    background-color: var(--input-bg-color-light);
    color: var(--input-color-light);
    border-color: var(--input-border-light);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body.dark .form-control, body.dark .form-select, body.dark .tox-tinymce {
    background-color: var(--input-bg-color-dark);
    color: var(--input-color-dark);
    border-color: var(--input-border-dark);
}

.form-control::placeholder {
    color: var(--muted-text-color-light);
}

body.dark .form-control::placeholder {
    color: var(--muted-text-color-dark);
}

.form-label {
    color: var(--text-color-light);
}

body.dark .form-label {
    color: var(--text-color-dark);
}

input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 1px var(--bs-primary);
    outline: none;
}

.form-control:focus {
    box-shadow: 0 0 1px var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

body.light .form-select:focus,
body.dark .form-select:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 2px var(--bs-primary) !important;
}

/* Links */
a {
    color: var(--link-color-light);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: color-mix(in srgb, var(--link-color-light) 85%, black);
}

body.dark a {
    color: var(--link-color-dark);
}

body.dark a:hover {
    color: color-mix(in srgb, var(--link-color-dark) 85%, white);
}

a.nav-link,
.nav-link {
    color: #fff;
}

a.nav-link:hover,
.nav-link:hover,
a.nav-link:active,
.nav-link:active,
.nav-link:focus {
    color: var(--bs-primary) !important;
}

/* Alerts */
.alert {
    border-radius: 10px;
    margin-bottom: 2rem;
    z-index: 1050;
}

.alert-danger {
    background-color: var(--alert-danger-bg-light);
    color: var(--alert-danger-text-light);
}

body.dark .alert-danger {
    background-color: var(--alert-danger-bg-dark);
    color: var(--alert-danger-text-dark);
}

.alert-success {
    background-color: var(--alert-success-bg-light);
    color: var(--alert-success-text-light);
}

body.dark .alert-success {
    background-color: var(--alert-success-bg-dark);
    color: var(--alert-success-text-dark);
}

.alert-info {
    background-color: var(--alert-info-bg-light);
    color: var(--alert-info-text-light);
}

body.dark .alert-info {
    background-color: var(--alert-info-bg-dark);
    color: var(--alert-info-text-dark);
}

body.dark .alert {
    color: inherit;
}

#alertContainer {
    position: fixed;
    top: calc(var(--navbar-height) + 20px);
    right: 20px;
    z-index: 1060;
    width: 300px;
}

#alertContainer .alert {
    margin-bottom: 10px;
}

/* Headings */
h2 {
    color: var(--bs-primary);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--navbar-bg-color);
    border-radius: 5px;
}

body.dark h2 {
    color: var(--text-color-dark);
}

body.dark h2::after {
    background-color: var(--text-color-dark);
}

/* Index.php Styles */
.search-container {
    max-width: 600px;
    margin: 0 auto 2rem;
    padding: 0.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color: var(--card-bg-color-light);
    animation: slideUp 0.5s ease-in;
}

body.dark .search-container {
    background-color: var(--card-bg-color-dark);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    border: none;
    border-radius: 10px;
    padding: 12px 12px 12px 40px;
    background-color: var(--input-bg-color-light);
    color: var(--input-color-light);
    transition: box-shadow 0.3s, transform 0.2s;
    width: 100%;
}

body.dark .search-input {
    background-color: var(--input-bg-color-dark);
    color: var(--input-color-dark);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--search-icon-color-light);
    font-size: 1.2rem;
}

body.dark .search-icon {
    color: var(--search-icon-color-dark);
}

.search-button {
    border-radius: 10px;
    padding: 12px 20px;
    margin-left: 10px;
    background-color: var(--bs-primary);
    border: none;
    color: #fff;
    transition: background-color 0.3s, transform 0.2s;
    white-space: nowrap;
}

.search-button:hover {
    background-color: color-mix(in srgb, var(--bs-primary) 80%, black);
    transform: translateY(-2px);
}

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: var(--navbar-height);
}

.hero-section h1 {
    font-size: 2.5rem;
    color: var(--text-color-light);
    margin-bottom: 0.5rem;
}

body.dark .hero-section h1 {
    color: var(--text-color-dark);
}

.hero-section p {
    color: var(--muted-text-color-light);
    font-size: 1.1rem;
}

body.dark .hero-section p {
    color: var(--muted-text-color-dark);
}

.category-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-btn {
    border-radius: 10px;
    padding: 10px 20px;
    background-color: var(--category-btn-bg-light);
    color: var(--category-btn-text-light);
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

body.dark .category-btn {
    background-color: var(--category-btn-bg-dark);
    color: var(--category-btn-text-dark);
}

.category-btn:hover {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--bs-primary);
}

.category-btn.active {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px var(--bs-primary);
}

/* Dashboard Styles */
.overview-card {
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.overview-card:hover {
    transform: translateY(-5px);
}

#overviewChart {
    max-height: 400px;
}

body.light h2, body.light .card-title {
    color: var(--bs-primary) !important;
}

body.light h2::after {
    background-color: var(--navbar-bg-color) !important;
}

/* View Article */
.article-content {
    color: var(--text-color-light);
    line-height: 1.7;
}

body.dark .article-content {
    color: var(--text-color-dark);
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.article-content a {
    color: var(--navbar-bg-color);
    text-decoration: none;
    transition: color 0.2s;
}

.article-content a:hover {
    color: color-mix(in srgb, var(--bs-primary) 80%, black);
    text-decoration: underline;
}

.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6 {
    color: var(--navbar-bg-color) !important;
}

.pdf-viewer {
    width: 100%;
    height: 600px;
    border: 1px solid var(--muted-text-color-light);
    border-radius: 8px;
    background-color: var(--hero-bg-color-light);
}

body.dark .pdf-viewer {
    border-color: var(--muted-text-color-dark);
    background-color: var(--card-bg-color-dark);
}

.pdf-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-end;
}

.pdfViewerContainer {
    width: 79vw;
    min-height: 500px;
    max-height: 650px;
    overflow-y: auto;
    box-shadow: 0 0 20px #ccc;
    background: #f8f9fa;
}

body.dark .pdfViewerContainer {
    background: var(--card-bg-color-dark);
}

/* Profile */
.logo-img {
    max-height: 70px;
}

.invalid-feedback {
    display: none;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Article */
.pdf-link-container {
    margin-top: 1rem;
}

/* Card Layout */
.row {
    display: flex;
    flex-wrap: wrap;
}

.card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-text p {
    margin: 0 0 0.5em 0;
    line-height: 1.5;
}

.card-text br {
    display: block;
    margin-bottom: 0.5em;
}

.card-text ul {
    padding-left: 20px;
    margin: 0 0 0.5em 0;
}

.card-text li {
    margin-bottom: 0.25em;
}

.card-text strong {
    font-weight: bold;
}

.card-text em {
    font-style: italic;
}

/* Miscellaneous */
.dropdown-item:active {
    background-color: var(--navbar-bg-color) !important;
}

a.page-link, a.page-link.dark, a.page-link:hover, a.page-link.dark:hover, a.page-link:active, a.page-link.dark:active, a.page-link:focus, a.page-link.dark:focus {
    color: var(--bs-primary);
}

.active>.page-link, .page-link.active {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.page-link:focus {
    box-shadow: var(--bs-primary);
}

.container-login100 {
    background: linear-gradient(-135deg, var(--navbar-bg-color), var(--navbar-bg-color)) !important;
}

.focus-input100, .symbol-input100 {
    color: var(--navbar-bg-color) !important;
}

.logo-preview {
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-border-top {
    border-top: 1px solid #ccc !important;
    border-radius: 0;
    padding-top: 10px;
}

/* Navbar Collapse */
.navbar-collapse {
    transition: all 0.4s ease-in-out;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        display: none;
    }
    .navbar-collapse.show {
        display: block;
    }
}

/* Responsive Styles */
@media (min-width: 576px) {
    .main-content-wrapper {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (min-width: 768px) {
    .main-content-wrapper {
        padding-left: 50px;
        padding-right: 50px;
    }
}

@media (min-width: 992px) {
    .main-content-wrapper {
        padding-left: 80px;
        padding-right: 80px;
    }
}

@media (min-width: 1200px) {
    .main-content-wrapper {
        padding-left: 120px;
        padding-right: 120px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        padding: 60px 30px;
    }
    .main-content-container {
        padding: 3rem;
        padding-top: 5rem;
    }
    .main-content-wrapper {
        padding: 2rem 10px;
        padding-top: 5rem !important;
    }
    .pdfViewerContainer {
        width: 100%;
        max-height: 500px;
    }
}

@media (max-width: 991px) {
    #sidebarMenu {
        top: var(--navbar-height);
        transform: translateX(-100%);
        width: var(--sidebar-width);
        transition: transform 0.4s ease-in-out;
        height: 100%;
        overflow-y: auto;
    }
    #sidebarMenu.show {
        transform: translateX(0);
    }
    #sidebarMenu.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        margin-top: var(--navbar-height);
        transition: margin-left 0.4s ease-in-out, width 0.4s ease-in-out;
    }
    .main-content.expanded {
        margin-left: 0;
        width: 100%;
    }
    .pdf-actions {
        justify-content: center !important;
    }
    .pdf-viewer {
        display: none !important;
    }
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 70px;
    }
    .navbar-custom {
        padding: 0.8rem 0;
    }
    .main-content {
        padding: 40px 15px;
        margin-top: var(--navbar-height);
    }
    .main-content-container {
        padding: 1.5rem;
    }
    .main-content-wrapper {
        padding: 1.5rem 10px;
    }
    .hero-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    .search-container {
        margin: 0 10px 1.5rem;
    }
    .search-form {
        flex-direction: column;
    }
    .search-button {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    .search-icon {
        top: 20%;
        bottom: 61px;
    }
    .category-container {
        gap: 6px;
    }
    .article-card {
        margin-bottom: 1rem;
    }
    .pdf-viewer {
        height: 300px;
        display: none;
    }
    .pdf-actions {
        align-self: center;
    }
    #alertContainer {
        width: 90%;
        right: 5%;
        top: calc(var(--navbar-height) + 10px);
    }
    footer {
        padding: 1rem 0;
        text-align: center;
    }
}

@media (max-width: 576px) {
    :root {
        --navbar-height: 60px;
    }
    .navbar-custom {
        padding: 0.8rem 0;
    }
    .main-content {
        padding: 30px 10px;
    }
    .main-content-container {
        padding: 1rem;
    }
    .main-content-wrapper {
        padding: 1rem 5px;
    }
    .search-container {
        margin: 0 5px 1rem;
    }
    .category-container {
        gap: 5px;
    }
    .pdf-viewer {
        height: 250px;
        display: none;
    }
    .pdfViewerContainer {
        width: 100%;
        min-height: 300px;
        max-height: 400px;
    }
    #alertContainer {
        width: 95%;
        right: 2.5%;
        top: calc(var(--navbar-height) + 5px);
    }
}

@media (max-width: 400px) {
    .main-content {
        padding: 20px 5px;
    }
    .main-content-container {
        padding: 0.8rem;
    }
    .main-content-wrapper {
        padding: 0.8rem 3px;
    }
    .hero-section {
        padding: 0.8rem;
    }
    .search-container {
        margin: 0 3px 0.8rem;
        margin-bottom: 2rem;
    }
    .category-container {
        gap: 4px;
    }
}

/* Estilos do Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--body-bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-in-out;
}

body.dark .preloader {
    background-color: var(--body-bg-dark);
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    position: relative;
    animation: pulse 1.5s ease-in-out infinite;
}

.preloader-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: block;
    margin-bottom: 1rem;
}

body.dark .preloader-text {
    color: var(--text-color-dark);
}

.preloader-bar {
    position: relative;
    width: 200px;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.preloader-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background-color: var(--navbar-bg-color);
    animation: expand 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes expand {
    0% {
        width: 0;
        transform: translateX(-50%);
    }
    50% {
        width: 100%;
        transform: translateX(-50%);
    }
    100% {
        width: 0;
        transform: translateX(-50%);
    }
}

@media (max-width: 768px) {
    .preloader-text {
        font-size: 1.5rem;
    }
    .preloader-bar {
        width: 150px;
    }
}

@media (max-width: 576px) {
    .preloader-text {
        font-size: 1.2rem;
    }
    .preloader-bar {
        width: 120px;
    }
}