/* ==========================================================================
   covid19br.wcota.me - Modern Bootstrap 5 Stylesheet
   ========================================================================== */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --danger-color: #dc3545;
    --success-color: #198754;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Universal removal of underlines from links */
a,
a:hover,
a:focus,
a:active,
a:visited {
    text-decoration: none !important;
}

/* Offset for fixed navbar anchor navigation */
section,
div[id],
header[id],
h2[id],
h3[id] {
    scroll-margin-top: 80px;
}

/* Modern Top Navbar */
.navbar-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand img {
    height: 28px;
    width: 28px;
}

/* Hero Section */
.hero-header {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.6rem;
    }
    .hero-header {
        padding: 1.5rem 1rem;
    }
}

/* Quick Navigation Links */
#languageHeader {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

#languageHeader a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease-in-out;
}

#languageHeader a:hover {
    background-color: #e0f2fe;
}

/* KPI Stat Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
}

.kpi-card.border-danger-accent {
    border-top: 4px solid var(--danger-color);
}

.kpi-card.border-success-accent {
    border-top: 4px solid var(--success-color);
}

.kpi-card.border-primary-accent {
    border-top: 4px solid var(--primary-color);
}

.kpi-card.border-info-accent {
    border-top: 4px solid var(--info-color);
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

/* Detailed summary extraInfo */
.extra-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.kpi-card-dashboard {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-radius: 0.75rem !important;
}

.kpi-card-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.08) !important;
}

/* Action Buttons Bar */
.botoes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.botoes .btn {
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.45rem 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Main Content Cards */
.content-section {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
    .content-section {
        padding: 1.25rem;
    }
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.section-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: #334155;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Observation notes */
.obs {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 1rem;
}

/* Chart Container */
.chart-container {
    width: 100%;
    min-height: 480px;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    position: relative;
}

.chart-skeleton-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 460px;
    color: #64748b;
    gap: 0.75rem;
}

.chart-skeleton-placeholder .spinner-border {
    width: 1.75rem;
    height: 1.75rem;
    border-width: 0.2em;
    color: #3b82f6;
}

/* Map Iframe */
#map {
    width: 100%;
    height: 640px;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    #map {
        height: 450px;
    }
}

/* Filter controls */
.filter-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.filter-panel label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

/* Select2 customization */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single {
    height: 38px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.375rem !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #212529 !important;
    line-height: 36px !important;
    padding-left: 0.75rem !important;
    padding-right: 2rem !important;
    font-size: 0.95rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    right: 8px !important;
}

.select2-dropdown {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    z-index: 1060 !important;
    background-color: #ffffff !important;
}

.select2-search--dropdown {
    padding: 0.5rem !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.95rem !important;
    outline: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.select2-results__options {
    max-height: 250px !important;
}

.select2-results__option {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.95rem !important;
    color: #212529 !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: #e9ecef !important;
    color: #1e293b !important;
}

/* Data Tables Section */
.collapsible-table-header {
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.collapsible-table-header:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.collapsible-table-header a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-content-area {
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Modern DataTables styling */
.dataTables_wrapper {
    padding: 0.5rem 0;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.35rem 0.65rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    padding: 0.25rem 2.25rem 0.25rem 0.65rem;
    min-width: 5rem;
    margin: 0 0.35rem;
    display: inline-block;
    cursor: pointer;
}

/* Footer */
footer#footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 3rem 1rem 2rem;
    color: var(--text-muted);
}

footer#footer a {
    color: #0284c7;
    text-decoration: none;
}

footer#footer a:hover {
    color: #0369a1;
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.footer-icons a {
    color: #64748b;
    font-size: 1.5rem;
    transition: color 0.15s ease;
}

.footer-icons a:hover {
    color: #0284c7;
}

.footer-copyright {
    font-size: 0.85rem;
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* ECharts Container Polish & Toolbar */
.chart-container canvas {
    border-radius: 0.5rem;
}

.chart-toolbar {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 2px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    gap: 2px;
}

.chart-toolbar .chart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.chart-toolbar .chart-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.chart-toolbar .chart-btn.active {
    background: #e0f2fe;
    color: #0284c7;
    font-weight: 700;
}

.chart-container.mode-pan canvas {
    cursor: grab !important;
}

.chart-container.mode-pan canvas:active {
    cursor: grabbing !important;
}

@media (max-width: 768px) {
    .chart-toolbar {
        top: 6px;
        right: 8px;
        padding: 1px 3px;
        gap: 2px;
    }
    .chart-toolbar .chart-btn {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* Dashboard Quick Nav Bar */
.dashboard-nav-bar {
    background-color: #f8fafc;
}

.dashboard-nav-bar .btn {
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
}

/* Condensed Section Navigation */
.section-nav-condensed {
    margin-top: 1.5rem;
}

.section-nav-condensed .btn-group .btn {
    font-size: 0.8rem;
    font-weight: 500;
}

/* DataTables Pagination & Controls */
.dataTables_wrapper .pagination .page-link {
    cursor: pointer;
}

.dataTables_wrapper .pagination .page-item.disabled .page-link {
    cursor: not-allowed;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

