/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #4a90e2;
    color: white;
    padding: 20px 0;
}

header .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

.hero {
    background: linear-gradient(to right, #4a90e2, #357ABD);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero button {
    background-color: white;
    color: #357ABD;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}

.hero button:hover {
    background-color: #e6e6e6;
}

.features {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-around;
}

.feature-card {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    flex: 1 1 250px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    margin-bottom: 15px;
    color: #357ABD;
}

footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* About page */
.about-hero {
    background: linear-gradient(to right, #4a90e2, #357ABD);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.about-hero h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.about-hero p {
    font-size: 1.2rem;
}

.about-features {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-around;
}

.team {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.team h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.team p {
    font-size: 1.1rem;
    color: #555;
}

/* Contact page */
.contact-hero {
    background: linear-gradient(to right, #4a90e2, #357ABD);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.contact-hero h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Ranking page */
.ranking-hero {
    background: linear-gradient(to right, #4a90e2, #357ABD);
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.ranking-hero h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.ranking-hero p {
    font-size: 1.1rem;
}

.ranking-filters {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #357ABD;
}

.filter-group input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.btn-clear, .btn-filter {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.btn-clear {
    background-color: #ccc;
    color: #333;
}

.btn-filter {
    background-color: #357ABD;
    color: white;
}

.btn-clear:hover {
    background-color: #b3b3b3;
}

.btn-filter:hover {
    background-color: #2c5fa0;
}

.ranking-list {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ranking-card {
    background-color: white;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    padding: 15px;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.ranking-card:hover {
    transform: translateY(-5px);
}

.ranking-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #f5f5f5;
    padding: 5px;
}

.ranking-info h3 {
    margin: 0 0 8px 0;
    color: #357ABD;
    font-size: 1.2rem;
}

.ranking-info p {
    margin: 3px 0;
    font-size: 0.95rem;
    color: #555;
}

/* Paginação */
.pagination {
    max-width: 1100px;
    margin: 30px auto 60px auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #357ABD;
    border-radius: 5px;
    background-color: white;
    color: #357ABD;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.page-btn:hover {
    background-color: #357ABD;
    color: white;
}

.page-btn.active {
    background-color: #357ABD;
    color: white;
}

/* Admin login page */
.login-section {
    background: linear-gradient(to right, #4a90e2, #357ABD);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    flex-grow: 1;
}

.login-container {
    background-color: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-container h2 {
    color: #357ABD;
    margin-bottom: 10px;
}

.login-container p {
    color: #555;
    margin-bottom: 25px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-weight: bold;
    color: #357ABD;
    margin-bottom: 5px;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-login {
    background-color: #357ABD;
    color: white;
    font-weight: bold;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #2c5fa0;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 15px;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 10px;
}

.alert.error {
    background-color: #ffdddd;
    color: #a94442;
}

.alert.success {
    background-color: #ddffdd;
    color: #3c763d;
}

/* Admin dashboard page */
.admin-dashboard {
    background-color: #f5f5f5;
    padding: 80px 20px;
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dashboard-container {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    max-width: 600px;
    text-align: center;
}

.dashboard-container h2 {
    color: #357ABD;
    margin-bottom: 20px;
}

.dashboard-container p {
    color: #555;
    margin-bottom: 30px;
}

.btn-logout {
    display: inline-block;
    background-color: #357ABD;
    color: white;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
}

.btn-logout:hover {
    background-color: #2c5fa0;
}

/* Error page */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    padding: 2rem;
    background-color: #ffffff;
    margin: 3rem auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.error-container {
    background-color: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.error-page h2 {
    color: #e74c3c;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-page p {
    color: #555;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.error-page .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.error-page .btn:hover {
    background-color: #2980b9;
}

/* Orgão page */
.list-container {
    max-width: 80%;
    margin: 40px auto;
    padding: 20px 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Page title */
.list-container h1 {
    color: #357ABD;
    margin-bottom: 25px;
    font-size: 2rem;
    text-align: center;
}

/* Search form */
.list-container form.mb-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.list-container form.mb-3 button {
    padding: 10px 16px;
    height: 40px;
    background-color: #357ABD;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.list-container form.mb-3 button {
    padding: 8px 16px;
    background-color: #357ABD;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.list-container form.mb-3 button:hover {
    background-color: #2c5fa0;
}

/* ---- NOVO: Cards de órgãos ---- */
.orgaos-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    justify-content: center;
}

.list-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s;
}

.list-card:hover {
    transform: translateY(-5px);
}

.list-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

.list-card h3 {
    color: #357ABD;
    margin-bottom: 10px;
}

.list-card p {
    color: #555;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: inline-block;
    padding: 8px 12px;
    color: #357ABD;
    border: 1px solid #357ABD;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.pagination.page-link:hover {
    background-color: #357ABD;
    color: white;
}

.pagination .disabled {
    background-color: #eee;
    color: #999;
    cursor: not-allowed;
}

.list-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.list-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dropdown menu */
.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #4a90e2;
    min-width: 160px;
    border-radius: 5px;
    overflow: hidden;
    z-index: 10;
}

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: white;
    text-decoration: none;
    font-weight: normal;
}

.dropdown-content a:hover {
    background-color: #357ABD;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown input[type="checkbox"] {
    display: none;
}

.dropdown-label {
    cursor: pointer;
    display: block;
}

.dropdown-content {
    display: none;
    flex-direction: column;
}

.dropdown input[type="checkbox"]:checked + .dropdown-label + .dropdown-content {
    display: flex;
}

/* Responsividade */
@media (max-width: 768px) {
    .features {
        flex-direction: column;
        align-items: center;
    }

    header .container {
        flex-direction: column;
        gap: 10px;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-buttons {
        justify-content: flex-start;
    }

    .ranking-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ranking-card img {
        margin-bottom: 10px;
    }

    .list-container form.mb-3 {
        flex-direction: column;
        align-items: stretch;
    }

    .list-container form.mb-3 input[type="text"],
    .list-container form.mb-3 button {
        width: 100%;
        height: 44px;
        font-size: 1rem;
    }

    .list-container {
        padding: 15px;
        max-width: 90%;
    }

    .pagination{
        flex-wrap: wrap;
        gap: 6px;
    }

    .list-container h1 {
        font-size: 1.5rem;
    }

    /* Cards com 1 por linha no mobile */
    .orgaos-list {
        grid-template-columns: 1fr;
    }

    .header-nav {
        flex-direction: column;
        gap: 10px;
    }

    .dropdown-content {
        background-color: #4a90e2;
        border-radius: 5px;
        padding: 5px 0;
    }

    .dropdown-content a {
        padding: 10px 15px;
        color: white;
        font-weight: normal;
    }

    .filter-group {
        flex: 1 1 1em;
    }
}

@media (min-width: 768px) {
    .list-card {
        width: 48%; /* 2 por linha com pequeno espaço entre eles */
        flex-direction: row;
        align-items: flex-start;
    }

    .list-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        margin-left: 15px;
    }

    .list-search {
        height: 44px;
        width: 80%;
    }
}