/* 
 * DSgov - Design System do Governo Federal (Adaptado)
 * Consolidado para o Portal da Transparência
 * Versão: 1.2
 */

/* ==========================================================================
   1. Variables & Root
   ========================================================================== */
:root {
    --dsgov-blue: #004587;
    --dsgov-blue-dark: #003366;
    --dsgov-blue-light: #f0f6ff;
    --dsgov-bg-light: #f8f9fa;
    --dsgov-border: #e9ecef;
    --dsgov-text: #333;
    --dsgov-text-muted: #666;
    --dsgov-font-family: 'Rawline', 'Inter', sans-serif;
}

/* ==========================================================================
   2. Resets & Global Overrides
   ========================================================================== */
body {
    background-color: #fff !important;
    font-family: var(--dsgov-font-family) !important;
    color: var(--dsgov-text);
}

.content-wrapper {
    background: #fff !important;
}

/* Reset Header Gradients/Colors to DSgov Blue (Overrides AdminLTE/Bootstrap) */
.bg-gradient-primary, 
.bg-primary, 
.card-primary:not(.card-outline) > .card-header {
    background: var(--dsgov-blue) !important;
    background-image: none !important;
}

/* Reset Text Colors */
.text-primary { color: var(--dsgov-blue) !important; }
a.text-primary:hover { color: var(--dsgov-blue-dark) !important; }

/* Utilities */
.bg-light-blue { background-color: var(--dsgov-blue-light); }
.text-dsgov-blue { color: var(--dsgov-blue); }

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.dsgov-title {
    color: var(--dsgov-blue-dark);
    font-weight: 700;
    font-family: var(--dsgov-font-family);
}

.dsgov-title {
    font-size: 2rem;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .dsgov-title { font-size: 1.5rem; }
}

.dsgov-subtitle {
    color: var(--dsgov-text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--dsgov-border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.dsgov-subtitle.border-left-style {
    border-bottom: none;
    border-left: 4px solid var(--dsgov-blue);
    padding-left: 15px;
}

/* ==========================================================================
   4. Navigation Components
   ========================================================================== */

/* Top Bar */
.dsgov-topbar {
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    margin-bottom: 20px;
}
.dsgov-logo { height: 40px; }
.dsgov-header-title { color: var(--dsgov-blue); font-weight: 700; font-size: 1.2rem; }

/* Breadcrumbs */
.dsgov-breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 10px;
    font-size: 0.85rem;
}
.dsgov-breadcrumb-item a { color: var(--dsgov-blue); text-decoration: none; }
.dsgov-breadcrumb-item.active { color: #6c757d; }
.dsgov-breadcrumb-item + .dsgov-breadcrumb-item::before { content: ">"; padding: 0 5px; color: #ccc; }

/* Sidebar Navigation (painel_heder.php & contato.php) */
.dsgov-sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #999;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.dsgov-nav-link {
    display: block;
    padding: 12px 15px;
    color: #555;
    background: #fff;
    border: 1px solid var(--dsgov-border);
    border-bottom: none;
    transition: all 0.2s;
    text-decoration: none;
}
.dsgov-nav-link:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; }
.dsgov-nav-link:last-child { border-bottom: 1px solid var(--dsgov-border); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.dsgov-nav-link:hover { background: var(--dsgov-bg-light); color: var(--dsgov-blue); text-decoration: none; }
.dsgov-nav-link.active { background: var(--dsgov-blue); color: #fff; border-color: var(--dsgov-blue); }

/* Menu Card (Sidebar Accordion) */
.dsgov-menu-card {
    border: 1px solid var(--dsgov-border);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}
.dsgov-menu-header { background: #fff; }
.dsgov-menu-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    color: #444;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.dsgov-menu-btn:hover { background: var(--dsgov-bg-light); color: var(--dsgov-blue); text-decoration: none; }
.dsgov-menu-btn[aria-expanded="true"] { background: var(--dsgov-blue-light); color: var(--dsgov-blue); font-weight: 600; }
.dsgov-menu-body { background: #fafafa; border-top: 1px solid var(--dsgov-border); padding: 10px 0; }
.dsgov-menu-link {
    display: block;
    padding: 8px 20px;
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.dsgov-menu-link:hover { color: var(--dsgov-blue); background: #fff; border-left-color: var(--dsgov-blue); text-decoration: none; }

/* ==========================================================================
   5. Components
   ========================================================================== */

/* Filters Bar */
.dsgov-filters-bar {
    background: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--dsgov-border);
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dsgov-filters-bar .form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

/* Buttons */
.dsgov-btn-action {
    border-radius: 4px;
    font-size: 0.9rem;
    padding: 6px 12px;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
}
.dsgov-btn-filled {
    background: var(--dsgov-blue);
    color: #fff;
    border: 1px solid var(--dsgov-blue);
}
.dsgov-btn-filled:hover { background: var(--dsgov-blue-dark); color: #fff; text-decoration: none; }
.dsgov-btn-outline {
    background: transparent;
    color: var(--dsgov-blue);
    border: 1px solid var(--dsgov-blue);
}
.dsgov-btn-outline:hover { background: var(--dsgov-bg-light); color: var(--dsgov-blue-dark); text-decoration: none; }

/* Tables */
.dsgov-table-wrapper {
    border: 1px solid var(--dsgov-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}
.dsgov-table {
    width: 100%;
    margin-bottom: 0;
    background-color: transparent;
    border-collapse: collapse;
}
.dsgov-table thead th {
    background-color: var(--dsgov-bg-light);
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid var(--dsgov-border);
    border-top: none;
    vertical-align: middle;
    padding: 12px;
    text-align: left;
}
.dsgov-table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-top: 1px solid var(--dsgov-border);
    color: #444;
}
.dsgov-table tbody tr:hover { background-color: var(--dsgov-blue-light); }

/* Cards (Dashboard) */
.dsgov-card {
    background: #fff;
    border: 1px solid var(--dsgov-border);
    border-radius: 8px;
    height: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.dsgov-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--dsgov-blue);
}
.dsgov-card-header {
    background: var(--dsgov-blue-light);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--dsgov-border);
}
.dsgov-card-body { padding: 20px; }
.dsgov-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dsgov-blue-dark);
    margin-bottom: 15px;
    text-align: center;
}
.dsgov-list { list-style: none; padding: 0; margin: 0; }
.dsgov-list li { margin-bottom: 10px; }
.dsgov-list li a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.9rem;
}
.dsgov-list li a:hover { background: var(--dsgov-bg-light); color: var(--dsgov-blue); }

/* Tags */
.dsgov-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dsgov-blue);
    background-color: var(--dsgov-blue-light);
    border-radius: 12px;
    border: 1px solid rgba(0, 69, 135, 0.2);
}

/* Forms */
.dsgov-form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.dsgov-form-control:focus {
    border-color: var(--dsgov-blue);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 69, 135, 0.25);
}

/* Footer */
.modern-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 50px 0 30px;
    position: relative;
    overflow: hidden;
    margin-top: 50px;
}
.footer-brand { text-align: center; position: relative; z-index: 2; }
.footer-logo { height: 60px; width: auto; margin-bottom: 15px; filter: brightness(0) invert(1); }
.footer-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 5px; color: #ecf0f1; }
.footer-subtitle { font-size: 0.9rem; color: #bdc3c7; margin: 0; }
.footer-section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; color: #ecf0f1; display: flex; align-items: center; }
.footer-section-title i { margin-right: 10px; color: #3498db; }
.footer-item { display: flex; align-items: center; margin-bottom: 12px; padding: 8px 0; }
.footer-item i { color: #3498db; margin-right: 12px; width: 20px; text-align: center; }
.footer-item span { color: #bdc3c7; font-size: 0.9rem; }
.social-links { display: flex; justify-content: center; gap: 15px; }
.social-link { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: white; background: rgba(255,255,255,0.1); transition: all 0.3s; }
.social-link:hover { transform: translateY(-3px); background: #3498db; color: white; text-decoration: none; }
.modern-copyright { background: #1a252f; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); color: #bdc3c7; font-size: 0.9rem; }
.developer-link { color: #3498db; text-decoration: none; font-weight: 600; }

/* ==========================================================================
   6. Accessibility & Header Extensions
   ========================================================================== */

/* Acessibilidade */
.dsgov-accessibility-bar {
    background-color: #343a40;
    color: #fff;
    font-size: 0.85rem;
    padding: 5px 0;
}
.dsgov-accessibility-bar a { 
    color: #fff; 
    text-decoration: none; 
    margin-left: 15px; 
    transition: opacity 0.2s; 
}
.dsgov-accessibility-bar a:hover { opacity: 0.8; }

/* Alto Contraste via Filtro */
body.high-contrast {
    filter: invert(1) hue-rotate(180deg);
    background-color: #000 !important; /* Inverted white is black */
    min-height: 100vh;
}
body.high-contrast img, 
body.high-contrast video, 
body.high-contrast iframe,
body.high-contrast .lai-bg-icon {
    filter: invert(1) hue-rotate(180deg);
}

/* Força fundo branco (que vira preto) em elementos estruturais */
body.high-contrast .bg-white,
body.high-contrast .card,
body.high-contrast .list-group-item,
body.high-contrast .content-wrapper,
body.high-contrast .container, 
body.high-contrast .container-fluid {
    background-color: #fff !important; 
    color: #000 !important; /* Text becomes white after inversion */
}

/* Destaque para Inputs e Fontes em Alto Contraste */
body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea,
body.high-contrast .form-control {
    border: 2px solid #00bfff !important; /* Azul Claro (DeepSkyBlue) para alto contraste no fundo preto */
    font-weight: 700 !important;
    color: #000 !important;
    background-color: #fff !important;
}

body.high-contrast * {
    text-shadow: 0 0 1px rgba(0,0,0,0.5); /* Melhora a legibilidade */
}

body.high-contrast h1, 
body.high-contrast h2, 
body.high-contrast h3, 
body.high-contrast h4, 
body.high-contrast h5, 
body.high-contrast h6,
body.high-contrast p,
body.high-contrast span,
body.high-contrast a {
    color: #000 !important; /* Garante que todo texto seja preto (vira branco) */
}

/* Busca */
.topbar-search .form-control {
    border-radius: 20px 0 0 20px;
    border-right: none;
}
.topbar-search .input-group-append .btn {
    border-radius: 0 20px 20px 0;
    border-left: none;
    background: #fff;
    border: 1px solid #ced4da;
}
.topbar-search .form-control:focus,
.topbar-search .input-group-append .btn:focus {
    box-shadow: none;
    border-color: #80bdff;
    z-index: 0;
}
