/* =============================================
   ENEM Rankings 2025 — Elivre
   ============================================= */

:root {
    --bg:        #0F1117;
    --surface:   #1A1D27;
    --surface2:  #22263A;
    --border:    #2D3148;
    --accent:    #6C63FF;
    --accent2:   #A78BFA;
    --text:      #E8E9F0;
    --text-muted:#8B8FA8;
    --green:     #10B981;
    --yellow:    #F59E0B;
    --red:       #EF4444;
    --radius:    10px;
    --font-body: 'Inter', sans-serif;
    --font-head: 'Space Grotesk', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--text); }

.container { max-width: 1300px; margin: 0 auto; padding: 0 24px; }

/* NAV */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 60px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-icon { color: var(--accent); font-size: 18px; }
.brand-text { font-family: var(--font-head); font-size: 16px; letter-spacing: 0.02em; }
.navbar-links a {
    color: var(--text-muted); font-size: 14px; padding: 6px 14px;
    border-radius: 6px; transition: all .2s;
}
.navbar-links a:hover, .navbar-links a.active {
    color: var(--text); background: var(--surface2);
}

/* HERO */
.hero {
    padding: 80px 32px 60px;
    background: radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.12) 0%, transparent 60%);
    border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-eyebrow {
    font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
.hero h1 {
    font-family: var(--font-head); font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.1; font-weight: 700; margin-bottom: 20px;
}
.hero-accent { color: var(--accent); }
.hero-sub { color: var(--text-muted); font-size: 17px; max-width: 540px; margin-bottom: 32px; }

.btn-primary {
    display: inline-block; background: var(--accent); color: #fff;
    padding: 12px 28px; border-radius: var(--radius);
    font-weight: 600; font-size: 15px; border: none; cursor: pointer;
    transition: opacity .2s; text-decoration: none;
}
.btn-primary:hover { opacity: 0.88; color: #fff; }
.btn-full { width: 100%; text-align: center; }

/* STATS BAR */
.stats-bar {
    display: flex; align-items: center; justify-content: center; gap: 0;
    padding: 28px 32px; background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.stat-item { text-align: center; padding: 0 40px; }
.stat-num {
    display: block; font-family: var(--font-head);
    font-size: 2rem; font-weight: 700; color: var(--accent2);
}
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* QUICK SEARCH */
.quick-search-section { padding: 48px 32px; }
.quick-search-section h2 {
    font-family: var(--font-head); font-size: 1.4rem; margin-bottom: 20px;
}
.quick-search-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.form-group-wide { flex: 2; }
.form-group label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
select, input[type="text"] {
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); padding: 10px 12px; border-radius: 6px;
    font-size: 14px; font-family: var(--font-body); outline: none;
    transition: border-color .2s;
}
select:focus, input[type="text"]:focus { border-color: var(--accent); }

/* INFO SECTION */
.info-section {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px; padding: 40px 24px;
}
.info-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
}
.info-icon { font-size: 28px; margin-bottom: 12px; }
.info-card h3 { font-family: var(--font-head); font-size: 1rem; margin-bottom: 8px; }
.info-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* PAGE HEADER */
.page-header {
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 32px 0;
}
.page-header h1 { font-family: var(--font-head); font-size: 1.8rem; }
.page-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.back-link { font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }

/* RANKING LAYOUT */
.ranking-layout {
    display: grid; grid-template-columns: 240px 1fr;
    gap: 24px; padding-top: 28px; padding-bottom: 48px;
    align-items: start;
}

/* FILTROS */
.filtros-panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    position: sticky; top: 76px;
}
.filtros-header {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 14px; margin-bottom: 20px;
}
.limpar-link { font-size: 12px; color: var(--text-muted); }
.limpar-link:hover { color: var(--red); }
.filtro-group { margin-bottom: 16px; }
.filtro-group label {
    display: block; font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; font-weight: 500;
}
.filtro-group select, .filtro-group input {
    width: 100%; font-size: 13px;
}
.btn-export {
    display: block; text-align: center; margin-top: 12px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text-muted); padding: 10px; border-radius: 6px;
    font-size: 13px; transition: all .2s;
}
.btn-export:hover { border-color: var(--accent); color: var(--accent2); }

/* TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ranking-table thead { background: var(--surface2); }
.ranking-table th {
    padding: 12px 14px; text-align: left; font-weight: 600;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); white-space: nowrap; border-bottom: 1px solid var(--border);
}
.ranking-table th a { color: var(--text-muted); }
.ranking-table th a:hover { color: var(--accent2); }
.th-pos { width: 50px; }
.th-num, .td-num { text-align: right !important; width: 60px; }
.th-rede { width: 80px; }
.th-geral { width: 80px; text-align: right !important; }

.escola-row {
    border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background .15s;
}
.escola-row:hover { background: var(--surface2); }
.escola-row:last-child { border-bottom: none; }
.ranking-table td { padding: 11px 14px; }

.td-pos { color: var(--text-muted); font-size: 12px; }
.td-pos-rank { text-align: center; font-size: 12px; font-weight: 700; color: var(--accent2); white-space: nowrap; width: 52px; }
.td-pos-uf { color: var(--text-muted); font-weight: 600; }
.td-nome a { color: var(--text); font-weight: 500; display: block; }
.td-nome a:hover { color: var(--accent2); }
.cod-inep { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }
.td-local { color: var(--text-muted); font-size: 12px; }
.uf-badge {
    display: inline-block; background: var(--surface2);
    border: 1px solid var(--border); color: var(--text-muted);
    font-size: 10px; padding: 1px 6px; border-radius: 4px;
    margin-left: 6px; font-weight: 600;
}
.td-geral { text-align: right; }
.nota-geral {
    font-family: var(--font-head); font-weight: 700;
    font-size: 15px; color: var(--accent2);
}

/* Badges de rede */
.badge-rede {
    display: inline-block; font-size: 11px; padding: 2px 8px;
    border-radius: 20px; font-weight: 600;
}
.badge-2 { background: rgba(16,185,129,0.15); color: var(--green); }
.badge-3 { background: rgba(108,99,255,0.15); color: var(--accent2); }
.badge-1 { background: var(--surface2); color: var(--text-muted); }

/* PAGINAÇÃO */
.paginacao {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 24px 0;
}
.pag-btn {
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); padding: 8px 18px; border-radius: 6px;
    font-size: 13px; transition: all .2s;
}
.pag-btn:hover { border-color: var(--accent); color: var(--accent2); }
.pag-info { font-size: 13px; color: var(--text-muted); }

/* EMPTY STATE */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state a { color: var(--accent2); }

/* ESCOLA DETAIL */
.escola-layout { padding: 32px 24px; display: flex; flex-direction: column; gap: 32px; }

.posicoes-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.posicao-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
}
.posicao-destaque { border-color: var(--accent); }
.posicao-num {
    display: block; font-family: var(--font-head);
    font-size: 2.4rem; font-weight: 700; color: var(--accent2);
}
.posicao-destaque .posicao-num { color: var(--accent); font-size: 2.8rem; }
.posicao-label { font-size: 13px; color: var(--text-muted); }

.notas-section h2 { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 16px; }
.notas-grid { display: flex; flex-direction: column; gap: 12px; }
.nota-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
}
.nota-bar-wrap {
    background: var(--surface2); border-radius: 4px; height: 6px; margin-bottom: 10px; overflow: hidden;
}
.nota-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }
.nota-info { display: flex; justify-content: space-between; align-items: center; }
.nota-area { font-size: 14px; color: var(--text-muted); }
.nota-val { font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; }

.escola-info {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-muted); }

/* FOOTER */
footer {
    margin-top: auto; padding: 20px 32px;
    background: var(--surface); border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted); text-align: center;
}

@media (max-width: 900px) {
    .ranking-layout { grid-template-columns: 1fr; }
    .filtros-panel { position: static; }
    .posicoes-grid { grid-template-columns: repeat(2,1fr); }
    .info-section { grid-template-columns: 1fr; }
    .stats-bar { flex-wrap: wrap; gap: 16px; }
    .stat-divider { display: none; }
}
