/* Emendas Parlamentares - Public Styles */

.ep-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ep-header {
    text-align: center;
    margin-bottom: 25px;
}

.ep-title {
    font-size: 1.8rem;
    color: #1e3a5f;
    margin: 0 0 5px 0;
}

.ep-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Cards */
.ep-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.ep-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #ccc;
}

.ep-card-api { border-left-color: #28a745; }
.ep-card-compl { border-left-color: #fd7e14; }
.ep-card-total { border-left-color: #007bff; }

.ep-card-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ep-card-value {
    font-size: 1.6rem;
    font-weight: bold;
    margin-top: 5px;
}

.ep-card-api .ep-card-value { color: #28a745; }
.ep-card-compl .ep-card-value { color: #fd7e14; }
.ep-card-total .ep-card-value { color: #007bff; }

.ep-card-sub {
    font-size: 0.85rem;
    color: #888;
    margin-top: 3px;
}

/* Filtros */
.ep-filtros {
    background: #fff;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ep-filtros label {
    font-weight: 600;
    color: #333;
}

.ep-btn-ano {
    padding: 8px 18px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.ep-btn-ano.active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

.ep-btn-ano:hover:not(.active) {
    background: #f0f0f0;
}

/* Cobertura */
.ep-cobertura {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ep-cobertura h3 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 15px 0;
}

.ep-cobertura-bar {
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
}

.ep-bar-api, .ep-bar-compl {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    transition: width 0.5s;
}

.ep-bar-api { background: linear-gradient(90deg, #28a745, #34ce57); }
.ep-bar-compl { background: linear-gradient(90deg, #fd7e14, #ffaa4d); }

.ep-legenda {
    display: flex;
    gap: 25px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.ep-legenda span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
}

.ep-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.ep-dot-api { background: #28a745; }
.ep-dot-compl { background: #fd7e14; }

/* Gráficos */
.ep-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ep-chart-box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ep-chart-box h3 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 15px 0;
}

/* Seções e Tabelas */
.ep-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ep-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ep-badge {
    background: #1e3a5f;
    color: #fff;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.ep-table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.ep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ep-table th {
    background: #f8f9fa;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
}

.ep-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
}

.ep-table tr:hover {
    background: #f8f9fa;
}

.ep-table .ep-valor {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.ep-table .ep-valor-positivo {
    color: #28a745;
    font-weight: 600;
}

.ep-parlamentar {
    font-weight: 600;
    color: #1e3a5f;
}

/* Loading */
.ep-loading {
    text-align: center;
    padding: 40px;
    display: none;
}

.ep-loading.active {
    display: block;
}

.ep-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: ep-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error */
.ep-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

/* Lista de Municípios */
.ep-lista-municipios {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.ep-lista-municipios h2 {
    text-align: center;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.ep-lista-municipios > p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.ep-municipios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ep-municipio-card {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #1e3a5f;
    transition: all 0.3s;
    display: block;
}

.ep-municipio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-left-color: #fd7e14;
}

.ep-municipio-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.ep-municipio-card h3 {
    color: #1e3a5f;
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.ep-municipio-card p {
    color: #888;
    margin: 0 0 10px 0;
    font-size: 0.9rem;
}

.ep-municipio-link {
    background: #e8f4f8;
    color: #1e3a5f;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .ep-charts {
        grid-template-columns: 1fr;
    }
    
    .ep-cards {
        grid-template-columns: 1fr;
    }
    
    .ep-filtros {
        justify-content: center;
    }
}
