/* Custom CSS properties */
:root {
    --primary-color: #0b4a8e;
    --primary-dark: #07356a;
    --secondary-color: #fca311;
    --secondary-dark: #e08f0a;
    --text-dark: #1f2937;
    --text-light: #4b5563;
    --text-white: #ffffff;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.25rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.125rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    box-shadow: var(--shadow-md);
}

/* Header & Nav */
.header {
    background-color: var(--header-bg, var(--bg-white));
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    color: var(--secondary-color);
    font-size: 2rem;
}

.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Dropdown Menu CSS */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
}

.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-menu .dropdown-menu {
    top: 0;
    left: 100%;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(var(--primary-color-rgb, 11, 74, 142), 0.8), rgba(var(--primary-dark-rgb, 7, 53, 106), 0.9)), url('https://images.unsplash.com/photo-1517048676732-d65bc937f952?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    color: var(--text-white);
    padding: 8rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.about-features {
    margin-top: 2rem;
}

.about-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.about-features i {
    color: var(--secondary-color);
}

.about-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* Accountability Section (Prestação de Contas) */
.filters {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.document-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.document-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.doc-icon {
    font-size: 3rem;
    color: #e53e3e; /* Red for PDF */
    margin-bottom: 1rem;
}

.doc-info {
    flex-grow: 1;
}

.doc-info h4 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.doc-info p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.doc-date {
    display: block;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.doc-actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.btn-icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-icon:hover {
    background-color: var(--bg-light);
    color: var(--primary-dark);
}

/* Modal PDF */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-white);
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-weight: 500;
}

.close-modal {
    color: var(--text-white);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close-modal:hover {
    color: var(--secondary-color);
}

.modal-body {
    padding: 0;
    background: #525659;
}

/* Footer */
.footer {
    background-color: var(--footer-bg, var(--text-dark));
    color: var(--footer-text-color, var(--text-white));
    padding: 4rem 0 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    color: var(--footer-text-color, var(--text-white));
    margin-bottom: 1.5rem;
}

.footer-info p {
    color: var(--footer-text-color, #9ca3af);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--secondary-color);
    color: var(--text-dark);
}

.footer-links h4, .footer-contact h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--footer-text-color, var(--text-white));
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--footer-text-color, #9ca3af);
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
    opacity: 1;
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--footer-text-color, #9ca3af);
    opacity: 0.8;
}

.footer-contact i {
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.footer-bottom {
    background-color: #111827;
    padding: 1.5rem 0;
    text-align: center;
    color: var(--footer-text-color, #6b7280);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-list {
        display: none; /* Mobile menu hidden by default */
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--bg-white);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
        gap: 0;
    }

    .nav-list.active {
        display: flex;
    }

    .nav-list li {
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 1rem;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: var(--bg-light);
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        min-width: 100%;
    }
    
    .dropdown.open > .dropdown-menu {
        display: block;
    }
    
    .dropdown:hover > .dropdown-menu {
        display: none;
    }
    
    .dropdown.open:hover > .dropdown-menu {
        display: block;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Notícias */
.news-section {
    padding: 5rem 0;
    background-color: var(--bg-white);
}
.news-ticker-container {
    overflow: hidden;
    height: 400px;
    position: relative;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: inset var(--shadow-sm);
}
.news-ticker {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: absolute;
    width: calc(100% - 2rem);
    animation: scrollTicker 30s linear infinite;
}
.news-ticker:hover {
    animation-play-state: paused;
}
.news-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    border-left: 4px solid var(--primary-color);
}
.news-card img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
}
.news-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}
.news-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.news-content .news-date {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.5rem;
}
.news-gallery {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.news-gallery img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    cursor: pointer;
}
.news-documents {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.news-documents a {
    font-size: 0.85rem;
    background: var(--bg-light);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.news-documents a:hover {
    background: var(--primary-color);
    color: var(--text-white);
}
@keyframes scrollTicker {
    0% { transform: translateY(100%); }
    100% { transform: translateY(-100%); }
}

/* --- Layout Variations Dinâmicas --- */

/* Documents List Mode */
.documents-grid.layout-list {
    display: flex;
    flex-direction: column;
}
.documents-grid.layout-list .document-card {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}
.documents-grid.layout-list .doc-icon {
    margin-bottom: 0;
}
.documents-grid.layout-list .doc-actions {
    margin-top: 0;
    margin-left: auto;
}

/* News Grid Mode */
.news-ticker-container.layout-grid {
    height: auto;
    overflow: visible;
    box-shadow: none;
    background: transparent;
    padding: 0;
}
.news-ticker-container.layout-grid .news-ticker {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    animation: none; /* Disable auto-scroll */
    width: 100%;
}
.news-ticker-container.layout-grid .news-card {
    flex-direction: column;
}
.news-ticker-container.layout-grid .news-card img {
    width: 100%;
    height: 180px;
}

/* Lightbox Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.gallery-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close-gallery {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-gallery:hover,
.close-gallery:focus {
    color: #bbb;
    text-decoration: none;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.gallery-nav:hover {
    background: rgba(255,255,255,0.2);
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

/* Formato de grid para as miniaturas de notícia */
.noticia-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.noticia-gallery-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.noticia-gallery-grid img:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.05);
}

/* Global Loading Overlay */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#global-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary-color, #0b4a8e);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

#global-loader p {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
    letter-spacing: 0.05em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
