* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2450ce;
    --primary-dark: #1a3a9e;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #fdd002;
    --info: #ed62d3;
    --bg: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8ed;
    --text: #1a1a2e;
    --text-secondary: #4a4a5a;
    --border: #d1d1d6;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, #e8e8ed 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 70px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 3rem;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #2450ce;
    text-shadow: 0 0 30px rgba(36, 80, 206, 0.3), 0 0 60px rgba(237, 98, 211, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}


.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(36, 80, 206, 0.15);
    transform: translateY(-2px);
}

.resultado-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: center;
}

.resultado-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 2px solid;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-sim { background: rgba(16, 185, 129, 0.1); border-color: var(--success); }
.stat-nao { background: rgba(239, 68, 68, 0.1); border-color: var(--danger); }
.stat-abstencao { background: rgba(253, 208, 2, 0.15); border-color: var(--warning); }
.stat-obstrucao { background: rgba(139, 92, 246, 0.1); border-color: #8b5cf6; }

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
}

.stat-sim .stat-value { color: var(--success); }
.stat-nao .stat-value { color: var(--danger); }
.stat-abstencao .stat-value { color: #d4a800; }
.stat-obstrucao .stat-value { color: #8b5cf6; }

.resultado-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    min-height: 300px;
    color: var(--text);
}

.resultado-chart canvas {
    max-width: 100%;
    height: auto !important;
}

select, input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

#proposicaoSelect {
    font-size: 0.9rem;
}

select:hover, input:hover { border-color: var(--primary); }

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 80, 206, 0.15);
}

.filters-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-group { margin-bottom: 1.5rem; }
.filter-group:last-child { margin-bottom: 0; }

.filter-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.chip {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

.chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chip-active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(36, 80, 206, 0.3);
}

.chip-yes { border-color: var(--success); }
.chip-yes.chip-active { background: var(--success); border-color: var(--success); color: white; }
.chip-no { border-color: var(--danger); }
.chip-no.chip-active { background: var(--danger); border-color: var(--danger); color: white; }
.chip-abstencao { border-color: var(--warning); }
.chip-abstencao.chip-active { background: var(--warning); border-color: var(--warning); color: #1a1a2e; }
.chip-obstrucao { border-color: #8b5cf6; }
.chip-obstrucao.chip-active { background: #8b5cf6; border-color: #8b5cf6; color: white; }

.table-wrapper, .table-wrapper-scroll {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.table-wrapper-scroll {
    max-height: 500px;
    overflow-y: auto;
}

table { width: 100%; border-collapse: collapse; }

thead {
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(36, 80, 206, 0.05); }

.table-wrapper-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrapper-scroll::-webkit-scrollbar-track { background: var(--bg-tertiary); border-radius: 10px; }
.table-wrapper-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
.table-wrapper-scroll::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

.deputado-info { display: flex; align-items: center; gap: 1rem; }

.deputado-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary);
    flex-shrink: 0;
}

.deputado-avatar img { width: 100%; height: 100%; object-fit: cover; }
.deputado-texto { display: flex; flex-direction: column; }
.deputado-nome { font-weight: 600; color: var(--text); }
.deputado-sub { font-size: 0.85rem; color: var(--text-secondary); }

.voto-pill {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    min-width: 80px;
}

.voto-sim { background: rgba(16, 185, 129, 0.15); color: #059669; border: 1px solid #10b981; }
.voto-não { background: rgba(239, 68, 68, 0.15); color: #dc2626; border: 1px solid #ef4444; }
.voto-abstenção { background: rgba(253, 208, 2, 0.2); color: #a16c00; border: 1px solid #fdd002; }
.voto-obstrução { background: rgba(139, 92, 246, 0.15); color: #7c3aed; border: 1px solid #8b5cf6; }

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.footer-content { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.footer-main { font-size: 1rem; }
.footer-credit { font-size: 0.9rem; color: var(--text-secondary); opacity: 0.8; }

footer a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

footer a:hover { color: var(--info); text-decoration: underline; }

.democratizar-link {
    font-weight: 600;
    background: linear-gradient(135deg, #ed62d3, #2450ce);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.democratizar-link:hover { opacity: 0.8; }

.loading-spinner { text-align: center; padding: 2rem; color: var(--text-secondary); }

.dots::after { content: ''; animation: dots 1.5s steps(3, end) infinite; }

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.helper-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.dot { width: 4px; height: 4px; background: var(--text-secondary); border-radius: 50%; }

@media (max-width: 768px) {
    .container { padding: 1rem; }
    h1 { font-size: 1.8rem; }
    .filters-row { padding: 1rem; }
    .filter-group { margin-bottom: 1rem; }
    .chip { padding: 0.5rem 1rem; font-size: 0.9rem; }
    .deputado-info { gap: 0.75rem; }
    .deputado-nome { font-size: 0.95rem; }
    .deputado-sub { font-size: 0.8rem; }
    table { font-size: 0.9rem; }
    th, td { padding: 0.75rem 0.5rem; }
    .col-partido, .col-uf, .col-data { display: none; }
    .col-parlamentar { width: 60%; }
    .col-voto { width: 40%; }
    .resultado-container { grid-template-columns: 1fr; gap: 1.5rem; }
    .resultado-stats { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-item { padding: 1rem; }
    .stat-label { font-size: 0.85rem; }
    .stat-value { font-size: 1.5rem; }
    .resultado-chart {
        padding: 1rem;
        min-height: 250px;
        max-height: 250px;
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }
    .resultado-chart canvas {
        max-width: 220px !important;
        max-height: 220px !important;
        width: 220px !important;
        height: 220px !important;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .subtitle { font-size: 0.95rem; }
    .card { padding: 1.5rem; }
    .chip { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
    .resultado-stats { gap: 0.5rem; }
    .stat-item { padding: 0.75rem; }
    .stat-label { font-size: 0.8rem; }
    .stat-value { font-size: 1.25rem; }
}

/* TOPO FIXO */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 245, 247, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
}

.fixed-header-content {
    max-width: 1400px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fixed-header-logos { display: flex; align-items: center; gap: 1.5rem; }

.fixed-header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.fixed-header-logo:hover { background: rgba(36, 80, 206, 0.1); color: var(--primary); }
.fixed-header-logo.radar { color: var(--primary); }
.fixed-header-separator { width: 1px; height: 30px; background: var(--border); }

@media (max-width: 768px) {
    .fixed-header { display: none; }
    body { padding-top: 0; }
}

@media (max-width: 480px) {
    .fixed-header-logo span { display: none; }
    .fixed-header-logo { font-size: 1.2rem; }
}

/* MENU HAMBURGER */
.hamburger-menu {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 1000;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hamburger-menu:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(36, 80, 206, 0.2);
    transform: translateY(-2px);
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger-menu:hover span { background: var(--primary); }

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.side-menu.active { right: 0; }

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.side-menu-header h2 { font-size: 1.5rem; color: var(--primary); margin: 0; }

.close-menu {
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.close-menu:hover { background: var(--bg-tertiary); color: var(--danger); }

.side-menu-list { list-style: none; padding: 1rem 0; margin: 0; }
.side-menu-list li { margin: 0; }

.side-menu-list a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.side-menu-list a:hover { background: var(--bg-tertiary); border-left-color: var(--primary); }
.side-menu-list a.active { background: rgba(36, 80, 206, 0.1); border-left-color: var(--primary); color: var(--primary); }

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.menu-overlay.active { opacity: 1; pointer-events: all; }

@media (max-width: 768px) {
    .hamburger-menu { width: 45px; height: 45px; top: 1rem; right: 1rem; }
    .side-menu {
        width: 280px;
        right: -280px;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }
    .side-menu.active { right: 0; }
}

/* CARDS DE DEPUTADOS - 6 por linha desktop */
#deputadosGrid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
}

.deputado-card {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.deputado-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(36, 80, 206, 0.15);
    transform: translateY(-4px);
}

.deputado-card-foto {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border);
}

.deputado-card-foto img { width: 100%; height: 100%; object-fit: cover; }

.deputado-card-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.deputado-card-partido { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.35rem; }
.deputado-card-votacoes { font-size: 0.75rem; color: var(--primary); font-weight: 600; }

/* Mobile - 3 por linha */
@media (max-width: 768px) {
    #deputadosGrid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
    }
    .deputado-card { padding: 0.6rem; }
    .deputado-card-foto { margin-bottom: 0.5rem; }
    .deputado-card-info h3 { font-size: 0.75rem; }
    .deputado-card-partido { font-size: 0.65rem; }
    .deputado-card-votacoes { font-size: 0.6rem; }
}

/* PÁGINA DE PERFIL */
.perfil-header { margin-bottom: 2rem; }

.perfil-header-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
}

.perfil-foto {
    width: 200px;
    height: 200px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 3px solid var(--primary);
}

.perfil-foto img { width: 100%; height: 100%; object-fit: cover; }
.perfil-info h1 { font-size: 2rem; margin-bottom: 0.5rem; color: var(--text); }
.perfil-dados { font-size: 1.2rem; color: var(--text-secondary); margin-bottom: 1rem; }
.perfil-redes { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.rede-social-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.rede-social-link:hover {
    border-color: var(--primary);
    background: rgba(36, 80, 206, 0.1);
    color: var(--primary);
}

.alinhamento-container {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 3rem;
    align-items: center;
}

.alinhamento-chart { display: flex; justify-content: center; align-items: center; }

.alinhamento-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-box {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.stat-box-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-box-value { font-size: 2rem; font-weight: 800; color: var(--primary); }

@media (max-width: 768px) {
    .perfil-header-content { grid-template-columns: 1fr; text-align: center; gap: 1.5rem; }
    .perfil-foto { margin: 0 auto; }
    .perfil-redes { justify-content: center; }
    .alinhamento-container { grid-template-columns: 1fr; gap: 2rem; }
    .alinhamento-chart { width: 100%; max-width: 200px; margin: 0 auto; }
    .alinhamento-chart canvas { max-width: 150px !important; max-height: 150px !important; width: 150px !important; height: 150px !important; }
    .alinhamento-stats { grid-template-columns: 1fr; }
}

.btn-ver-perfil {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-ver-perfil:hover { opacity: 0.9; transform: translateX(3px); }

#tabelaDeputados tbody tr { cursor: pointer; }
#tabelaDeputados tbody tr:hover { background: rgba(36, 80, 206, 0.08); }

.perfil-nome-civil { font-size: 1rem; color: var(--text-secondary); font-style: italic; margin-bottom: 1.5rem; }

.perfil-dados-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.perfil-dado-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.perfil-dado-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.perfil-dado-valor { font-size: 1rem; color: var(--text); font-weight: 500; }

@media (max-width: 768px) {
    .perfil-dados-grid { grid-template-columns: 1fr; gap: 0.75rem; }
}

.perfis-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; }

@media (max-width: 768px) {
    .perfis-filters { grid-template-columns: 1fr; }
}

.proposicao-select-container { display: flex; gap: 0.75rem; align-items: stretch; }
.proposicao-select-container select { flex: 1; }

.share-btn {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.share-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 80, 206, 0.3);
}

.share-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.share-btn svg { width: 20px; height: 20px; }

@media (max-width: 480px) {
    .proposicao-select-container { gap: 0.5rem; }
    .share-btn { width: 45px; height: 45px; }
    .share-btn svg { width: 18px; height: 18px; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}