/* Reset e Estilos Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00D084;
    --primary-dark: #00A86B;
    --text-dark: #1a1a1a;
    --text-light: #666666;
    --bg-light: #ffffff;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

body.dark-mode {
    --text-dark: #ffffff;
    --text-light: #cccccc;
    --bg-light: #1a1a1a;
    --bg-white: #1a1a1a;
    --border-color: #444444;
}

html, body {
    font-family: Sora, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: var(--transition);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Header */
.header {
    background-color: var(--bg-white);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Sora, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-right {
    justify-content: flex-end;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: Sora, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.crown-img {
    height: 30px;
    width: auto;
}

@keyframes floatCrown { 
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.logo-link {
    color: #4b5563;
    font-weight: 700;
    font-family: Sora, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-dark);
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: Sora, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.close-menu {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.logo-main {
    height: 40px;
    width: auto;
    max-width: 180px;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
}

.theme-toggle:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    color: var(--text-dark);
    transition: var(--transition);
}

.theme-toggle:hover svg {
    color: var(--primary-color);
}



.btn-link {
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
    font-family: Sora, -apple-system, BlinkMacSystemFont, sans-serif !important;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: Sora, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

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

.btn-primary:active {
    transform: translateY(0);
}

/* Navbar - Removed */

/* Hero Section */
.hero {
    background-color: #ffffff;
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

body.dark-mode .hero {
    background-color: #1a1a1a;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.5rem;
}

.hero-title-section {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex: 1;
}

.crown-large {
    height: 80px;
    width: auto;
    display: inline-block;
    animation: floatCrown 3.6s ease-in-out infinite;
}

.hero-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

/* Estilos do hero-status antigo removidos para o novo ticker */

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* New Navigation & Filters Style */
.navigation-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.main-tabs-wrapper, .time-filters {
    background-color: #f8f9fa;
    padding: 4px;
    border-radius: 14px;
    display: flex;
    gap: 2px;
}

.tabs-container {
    display: flex;
    gap: 4px;
}

.tab-btn, .filter-btn {
    background: none;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tab-btn:hover, .filter-btn:hover {
    color: #1a1a1a;
}

.tab-btn.active, .filter-btn.active {
    background-color: #ffffff;
    color: #000000;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.time-filters-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    background: none;
    border: none;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Search & Dropdown Filters Row */
.search-filters-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    font-size: 1rem;
    background-color: #fff;
    color: #1a1a1a;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: #aaa;
}

.search-input:focus {
    outline: none;
    border-color: #ddd;
}

.dropdown-filters {
    display: flex;
    gap: 0.8rem;
}

.dropdown-select {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.2rem;
    background-color: #f8f9fa;
    border-radius: 16px;
    color: #999;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-select:hover {
    background-color: #eee;
}

.dropdown-select.icon-only {
    padding: 0.8rem;
}

/* Ranking List */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    background-color: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ranking-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-color: #e5e5e5;
}

.ranking-position {
    font-size: 1.25rem;
    font-weight: 800;
    color: #d4af37;
    min-width: 40px;
}

.avatar-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
}

.ranking-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d4af37;
    padding: 2px;
}

.ranking-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ranking-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
}

.ranking-role {
    font-size: 0.85rem;
    color: #666;
}

.ranking-party-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.party-badge {
    background-color: #000;
    color: #f1c40f;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 3px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.points-badge {
    color: #999;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}
.points-badge i.ph-trophy { color: #f2a900; font-size: 0.95rem; }

.qa-spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid #e2e2e8; border-top-color: #00d796;
    animation: qaSpin 0.8s linear infinite;
}
@keyframes qaSpin { to { transform: rotate(360deg); } }

.ranking-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.sparkline-placeholder {
    width: 120px;
    height: 30px;
    stroke: #00D796;
    stroke-width: 2;
    fill: none;
}

.stat-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.stat-amount-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.glowing-dot {
    width: 8px;
    height: 8px;
    background-color: #00D796;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 215, 150, 0.6);
}

.stat-amount {
    color: #00D796;
    font-size: 1.1rem;
    font-weight: 800;
}

.stat-supporters {
    color: #888;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ranking-actions {
    margin-left: 1rem;
}

.favorite-star-control {
    display: inline-block;
    width: 1.25rem;
    height: 1.5rem;
    margin-left: 0.6rem;
    color: #d8d8d8;
    font-family: Arial, sans-serif;
    font-size: 1.45rem;
    font-weight: 400;
    line-height: 1.5rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.favorite-star-control:hover,
.favorite-star-control.is-active {
    color: #ffd700;
    transform: scale(1.08);
}

.favorite-star-control:focus,
.favorite-star-control:focus-visible,
.favorite-star-control:active {
    color: #ffd700;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
}

.ranking-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    background: none;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

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

.action-btn.favorite {
    color: var(--primary-color);
}

/* Load More Button */
.load-more-section {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-load-more {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-load-more:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Footer - Novo Layout */
.site-footer {
    max-width: 1400px;
    margin: 4rem auto 0;
    padding: 2.5rem 2rem 2rem;
    background-color: transparent;
    color: var(--text-dark);
}

.site-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-footer-hubpolitico {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid #d9d9d9;
    color: #333;
    font-size: 0.95rem;
    font-weight: 500;
}
.site-footer-hubpolitico b {
    color: #4c46b8;
    font-weight: 700;
}
body.dark-mode .site-footer-hubpolitico,
.dark-mode .site-footer-hubpolitico {
    color: #e5e5e5;
    border-left-color: #333;
}

.site-footer-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.site-footer-logo img {
    height: 40px;
    width: auto;
    display: block;
}

.site-footer-socials {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.site-footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a8a8a;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.site-footer-social:hover {
    color: #00d4aa;
    transform: translateY(-1px);
}

.site-footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1.15rem;
    background-color: #e6f9f2;
    color: #00b17a;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
}

.site-footer-badge svg {
    color: #00b17a;
    flex-shrink: 0;
}

.site-footer-divider {
    max-width: 1400px;
    margin: 1.75rem auto 1.25rem;
    border-top: 1px solid #e6e6e6;
}

.site-footer-legal {
    text-align: center;
    color: #6b6b6b;
    font-size: 0.95rem;
    line-height: 1.7;
}

.site-footer-legal p {
    margin: 0;
}

/* Colunas de links */
.site-footer-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    padding: 1rem 0 2rem;
}
.site-footer-col h4 {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 1rem;
}
.site-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}
.site-footer-col a {
    color: #4a4a4a;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.site-footer-col a:hover {
    color: #00b17a;
}
.ext-arrow {
    display: inline-block;
    margin-left: 0.2rem;
    font-size: 0.85em;
    color: #7a7a7a;
}
body.dark-mode .site-footer-col h4,
.dark-mode .site-footer-col h4 {
    color: #f0f0f0;
}
body.dark-mode .site-footer-col a,
.dark-mode .site-footer-col a {
    color: #c9c9c9;
}
body.dark-mode .site-footer-col a:hover,
.dark-mode .site-footer-col a:hover {
    color: #34e0a1;
}

/* Badges de app */
.site-footer-apps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
    flex-wrap: wrap;
}
.site-footer-apps-title {
    font-size: 0.9rem;
    color: #6b6b6b;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.site-footer-apps-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.95rem;
    background-color: #111;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
    min-width: 140px;
}
.app-badge:hover {
    transform: translateY(-1px);
    background-color: #000;
}
.app-badge-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.app-badge-text small {
    font-size: 0.62rem;
    text-transform: uppercase;
    opacity: 0.85;
    letter-spacing: 0.06em;
}
.app-badge-text strong {
    font-size: 1rem;
    font-weight: 700;
}
body.dark-mode .site-footer-apps-title,
.dark-mode .site-footer-apps-title {
    color: #b5b5b5;
}

@media (max-width: 900px) {
    .site-footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .site-footer-columns {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

body.dark-mode .site-footer,
.dark-mode .site-footer {
    color: #e5e5e5;
}

body.dark-mode .site-footer-divider,
.dark-mode .site-footer-divider {
    border-top-color: #2f2f2f;
}

body.dark-mode .site-footer-legal,
.dark-mode .site-footer-legal {
    color: #b5b5b5;
}

body.dark-mode .site-footer-badge,
.dark-mode .site-footer-badge {
    background-color: rgba(0, 209, 130, 0.12);
    color: #34e0a1;
}

body.dark-mode .site-footer-badge svg,
.dark-mode .site-footer-badge svg {
    color: #34e0a1;
}

body.dark-mode .site-footer-social,
.dark-mode .site-footer-social {
    color: #9a9a9a;
}

body.dark-mode .site-footer-social:hover,
.dark-mode .site-footer-social:hover {
    color: #34e0a1;
}

@media (max-width: 640px) {
    .site-footer-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .site-footer-brand {
        gap: 1.75rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        flex-wrap: wrap;
    }

    .header-left, .header-center, .header-right {
        flex: 1 1 100%;
    }

    .header-center {
        order: -1;
        margin-bottom: 1rem;
    }

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

    .hero-title {
        font-size: 1.75rem;
    }

    .crown-large {
        font-size: 2rem;
    }

    .hero-status {
        align-items: flex-start;
    }

    .ranking-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .ranking-stats {
        flex-direction: column;
        gap: 1rem;
        min-width: auto;
        width: 100%;
    }

    .ranking-actions {
        justify-content: center;
    }

    .navbar-container {
        grid-template-columns: 1fr;
    }

    .tabs-container {
        gap: 0.5rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .filters-section {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

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

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .crown-large {
        font-size: 1.5rem;
    }

    .ranking-item {
        padding: 1rem;
    }

    .ranking-position {
        font-size: 1.25rem;
    }

    .ranking-avatar {
        width: 50px;
        height: 50px;
    }

    .ranking-name {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 0.875rem;
    }

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ranking-item {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Ticker de Doações Animado */
.qa-ticker {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 8px 12px;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    font-family: Sora, sans-serif;
    min-height: 44px;
    margin-top: 1rem;
    width: 100%;
}

.qa-ticker-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.qa-live-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 215, 150, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
}

.qa-live-status-dot {
    width: 6px;
    height: 6px;
    background-color: #00D796;
    border-radius: 50%;
    animation: qa-pulse 2s infinite;
}

.qa-live-status-text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #00D796;
    letter-spacing: 0.05em;
}

.qa-ticker-title {
    font-size: 11px;
    color: rgb(154, 166, 161);
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.qa-ticker-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0px, rgb(0, 0, 0) 24px, rgb(0, 0, 0) calc(100% - 32px), transparent 100%);
}

.qa-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerLoop 45s linear infinite;
}

.qa-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    text-decoration: none;
    color: inherit;
    animation: tickerItemEnter 600ms ease-out both;
}

@keyframes tickerItemEnter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes amountBump {
    0%   { transform: scale(1);    color: inherit; }
    30%  { transform: scale(1.14); color: #00b17a; }
    100% { transform: scale(1);    color: inherit; }
}

.amount-bump {
    animation: amountBump 900ms ease-out;
    display: inline-block;
}

.qa-ticker-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
}

.qa-ticker-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qa-ticker-line {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.qa-ticker-name {
    font-size: 12px;
    font-weight: 600;
}

.qa-ticker-amount {
    font-size: 11px;
    font-weight: 700;
}

.qa-ticker-sep {
    width: 1px;
    height: 16px;
    background: #e0e0e0;
    margin: 0 16px;
}

.qa-ticker-logo {
    height: 16px;
    margin-right: 8px;
}

.qa-ticker-kicker {
    font-size: 10px;
    color: #666666;
}

.qa-ticker-bigvalue {
    font-size: 14px;
    font-weight: 700;
}

@keyframes qa-pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes tickerLoop {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Ajuste Hero para acomodar o ticker */
.hero-content {
    flex-direction: column;
    align-items: flex-start;
}

.hero-title-section {
    width: 100%;
}

body.dark-mode .qa-ticker {
    background: #2a2a2a;
    border: 1px solid #444;
}

/* Filter Modal Styles */
.filter-modal {
    position: absolute;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 200px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
}

.filter-modal-header {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    background: white;
}

.filter-modal-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
}

.filter-modal-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.filter-modal-item:hover {
    background: #f8f9fa;
}

.dark-mode .filter-modal {
    background: #222;
    border-color: #333;
    color: white;
}

.dark-mode .filter-modal-header {
    background: #222;
    border-color: #333;
}

.dark-mode .filter-modal-item:hover {
    background: #333;
}

/* State Code Avatar */
.state-code-avatar {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #00d796;
    font-size: 1.2rem;
    border: 2px solid #eee;
}

.dark-mode .state-code-avatar {
    background: #333;
    border-color: #444;
}

/* Pagination Bar Styles */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-show {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.show-options {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 50px;
}

.show-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-btn.active {
    background: #00d796;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 215, 150, 0.2);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-btn {
    border: 1px solid #e5e7eb;
    background: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

#pageIndicator {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4b5563;
}

/* Responsive Pagination */
@media (max-width: 640px) {
    .pagination-bar {
        flex-direction: column;
        align-items: center;
    }
}

/* Party Logo and State Styles */
.party-logo {
    object-fit: contain;
    background: white;
    padding: 4px;
}

.graphics-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px 0;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.dark-mode .chart-card {
    background: #2a2a2a;
    border: 1px solid #444;
}

.chart-card h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

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

.empty-state {
    padding: 60px;
    text-align: center;
    color: #999;
    font-size: 1rem;
}

/* Estilos Adicionais para Abas de Partidos e Estados */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.party-logo {
    object-fit: contain;
    padding: 6px;
    background-color: #f5f5f5;
    border-radius: 50%;
    border: 2px solid #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.party-logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.party-logo-img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

body.dark-mode .party-logo-circle,
.dark-mode .party-logo-circle {
    border-color: #d4af37;
}

body.dark-mode .party-logo {
    background-color: #2a2a2a;
    border-color: #d4af37;
}

.dark-mode .party-logo {
    background-color: #333;
}

.state-code-avatar {
    width: 40px;
    height: 40px;
    background-color: #00d796;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Estilos para Aba de Gráficos */
.graphics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #1a1a1a;
    font-weight: 600;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

.sparkline {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Ajustes Dark Mode */
.dark-mode .chart-card {
    background: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dark-mode .chart-card h3 {
    color: #f8f9fa;
}

.dark-mode .progress-bar-container {
    background-color: #333;
}

.dark-mode .state-code-avatar {
    background-color: #00A86B;
}

/* ===== v8: melhorias (re-sort FLIP, a11y, filtros, mobile) ===== */

/* Item 1: durante a animação FLIP o item fica acima dos demais e sem entrada */
.ranking-list.no-entrance .ranking-item {
    animation: none;
}
.ranking-item.flip-moving {
    position: relative;
    z-index: 5;
    will-change: transform;
}

/* Item 4: dropdown com filtro ativo */
.dropdown-select.has-filter {
    background-color: #00d796;
    color: #ffffff;
}
.dropdown-select.has-filter span {
    color: #ffffff;
}
.dark-mode .dropdown-select.has-filter {
    background-color: #00A86B;
}

/* Item 9: contraste dos textos claros (WCAG AA) */
.site-footer-legal { color: #4a4a4a; }
.site-footer-apps-title { color: #4a4a4a; }
.dropdown-select { color: #555; }
.dropdown-select span { color: #555; }
body.dark-mode .site-footer-legal,
.dark-mode .site-footer-legal { color: #cfcfcf; }
body.dark-mode .site-footer-apps-title,
.dark-mode .site-footer-apps-title { color: #cfcfcf; }

/* Item 9: focus-visible nos controles customizados */
.amount-btn-grid:focus-visible,
.show-btn:focus-visible,
.tab-btn:focus-visible,
.filter-btn:focus-visible,
.nav-btn:focus-visible,
.date-filter-btn:focus-visible,
.dropdown-select:focus-visible,
.btn-donate-primary:focus-visible,
.btn-primary:focus-visible,
.btn-link:focus-visible,
.theme-toggle:focus-visible,
.favorite-star-control:focus-visible,
.filter-modal-item:focus-visible {
    outline: 3px solid #0a7d5a;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Item 7: ticker AO VIVO legível em telas pequenas (<480px / 360x640) */
@media (max-width: 480px) {
    .qa-ticker {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px 10px;
    }
    .qa-ticker-badge {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding-right: 0;
        padding-bottom: 6px;
        justify-content: center;
    }
    .qa-ticker-viewport {
        width: 100%;
        mask-image: linear-gradient(to right, transparent 0px, #000 16px, #000 calc(100% - 16px), transparent 100%);
    }
    body.dark-mode .qa-ticker-badge {
        border-bottom-color: #444;
    }
    .dropdown-filters {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
    .ranking-item.flip-moving { transition: none !important; transform: none !important; }
    .qa-ticker-track { animation: none; }
    .crown-large { animation: none; }
}

/* ===== v9: dark mode funcional + layout mobile (igual referência) ===== */

/* Ícones do botão de tema */
.theme-toggle .icon-sun { display: none; }
body.dark-mode .theme-toggle .icon-moon { display: none; }
body.dark-mode .theme-toggle .icon-sun { display: block; }

/* Botão hambúrguer (só mobile) */
.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    padding: 6px;
    align-items: center;
    justify-content: center;
}
.header-container { position: relative; }

/* ---------- DARK MODE: cores reais (fundo quase preto, cards escuros) ---------- */
body.dark-mode {
    --text-dark: #ffffff;
    --text-light: #a8a8ad;
    --bg-light: #0d0d0f;
    --bg-white: #161618;
    --border-color: #2a2a2e;
}
body.dark-mode { background-color: #0d0d0f; color: #ffffff; }
body.dark-mode .header { background-color: #0d0d0f; }
body.dark-mode .logo-link { color: #e6e6e6; }
body.dark-mode .btn-link { color: #e6e6e6; }
body.dark-mode .hero { background-color: #0d0d0f; }
body.dark-mode .hero-subtitle { color: #00d796; }

body.dark-mode .main-tabs-wrapper,
body.dark-mode .time-filters { background-color: #1a1a1d; }
body.dark-mode .tab-btn,
body.dark-mode .filter-btn,
body.dark-mode .date-filter-btn { color: #9a9aa0; }
body.dark-mode .tab-btn:hover,
body.dark-mode .filter-btn:hover { color: #ffffff; }
body.dark-mode .tab-btn.active,
body.dark-mode .filter-btn.active { background-color: #2c2c30; color: #ffffff; box-shadow: none; }

body.dark-mode .search-input {
    background-color: #1a1a1d;
    border-color: #2a2a2e;
    color: #ffffff;
}
body.dark-mode .search-input::placeholder { color: #7a7a80; }
body.dark-mode .search-icon { color: #7a7a80; }

body.dark-mode .dropdown-select { background-color: #1a1a1d; color: #c9c9cf; }
body.dark-mode .dropdown-select span { color: #c9c9cf; }
body.dark-mode .dropdown-select:hover { background-color: #232327; }

body.dark-mode .ranking-item {
    background-color: #1a1a1d;
    border-color: #2a2a2e;
}
body.dark-mode .ranking-item:hover {
    border-color: #3a3a40;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
body.dark-mode .ranking-name { color: #ffffff; }
body.dark-mode .ranking-role { color: #9a9aa0; }
body.dark-mode .points-badge { color: #8a8a90; }
body.dark-mode .stat-supporters { color: #9a9aa0; }
body.dark-mode .ranking-position { color: #d4af37; }

body.dark-mode .pagination-show,
body.dark-mode #pageIndicator { color: #b5b5ba; }
body.dark-mode .show-options { background: #1a1a1d; }
body.dark-mode .show-btn { color: #9a9aa0; }
body.dark-mode .nav-btn { background: #1a1a1d; border-color: #2a2a2e; color: #e6e6e6; }
body.dark-mode .nav-btn:hover:not(:disabled) { background: #232327; }
body.dark-mode .nav-btn:disabled { background: #141416; }

body.dark-mode .state-code-avatar { background: #26262a; color: #00d796; border-color: #333; }
body.dark-mode .empty-state { color: #9a9aa0; }

/* ---------- LAYOUT MOBILE (linha compacta, igual à imagem de referência) ---------- */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: nowrap;
        padding: 0.4rem 1rem;
        gap: 0.5rem;
    }
    .header-left { flex: 1 1 auto; margin: 0; }
    .header-center { order: 0; flex: 0 0 auto; text-align: center; margin: 0; }
    .header-center .logo-main { height: 34px; }
    .header-right {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        right: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        background: var(--bg-white);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 0.85rem;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
        z-index: 300;
        min-width: 190px;
    }
    .header-right.mobile-open { display: flex; }
    .header-right .btn-link,
    .header-right .btn-primary { text-align: center; }
    .menu-toggle-btn { display: inline-flex; flex: 0 0 auto; }

    /* Ranking em linha, compacto */
    .ranking-item {
        flex-direction: row;
        text-align: left;
        align-items: center;
        gap: 0.55rem;
        padding: 1.15rem 0.85rem 0.85rem;
        position: relative;
    }
    .ranking-item .sparkline { display: none; }
    .ranking-position {
        position: absolute;
        top: 6px;
        left: 12px;
        font-size: 0.72rem;
        min-width: auto;
    }
    .favorite-star-control { order: -1; margin: 0; flex: 0 0 auto; }
    .avatar-wrapper, .ranking-avatar { width: 46px; height: 46px; flex: 0 0 auto; }
    .party-logo-circle { width: 46px; height: 46px; }
    .state-code-avatar { width: 46px; height: 46px; font-size: 0.8rem; }
    .ranking-info { gap: 3px; min-width: 0; flex: 1 1 auto; }
    .ranking-name { font-size: 0.92rem; line-height: 1.15; }
    .ranking-role { font-size: 0.78rem; }
    .ranking-party-pill { flex-wrap: nowrap; }
    .party-badge { padding: 2px 10px; font-size: 0.62rem; }
    .points-badge { font-size: 0.72rem; white-space: nowrap; }
    .ranking-stats {
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
        width: auto;
        min-width: 0;
        flex: 0 0 auto;
        margin-left: auto;
    }
    .stat-amount { font-size: 0.92rem; white-space: nowrap; }
    .stat-supporters { font-size: 0.72rem; white-space: nowrap; }
}

/* Estrela: à direita no desktop (após as stats), à esquerda no mobile */
.ranking-item > .favorite-star-control { order: 5; margin-left: 0.6rem; }
@media (max-width: 768px) {
    .ranking-item > .favorite-star-control { order: -1; margin-left: 0; }
}

/* ===== v9.1: correções (overflow mobile + ticker dark) ===== */

/* Ticker legível no modo escuro */
body.dark-mode .qa-ticker { color: #f0f0f0; }
body.dark-mode .qa-ticker-name { color: #f5f5f5; }
body.dark-mode .qa-ticker-kicker { color: #b5b5ba; }
body.dark-mode .qa-ticker-total-label { color: #b5b5ba; }
body.dark-mode .qa-ticker-total-value { color: #ffffff; }
body.dark-mode .qa-ticker-sep { background-color: #3a3a40; }

/* Evita rolagem horizontal do documento no mobile: só as faixas de abas/filtros rolam */
@media (max-width: 768px) {
    .navigation-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        max-width: 100%;
    }
    .main-tabs-wrapper,
    .time-filters-wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .main-tabs-wrapper::-webkit-scrollbar,
    .time-filters-wrapper::-webkit-scrollbar { height: 0; display: none; }
    .tabs-container { flex-wrap: nowrap; }
    .time-filters { flex-wrap: nowrap; }
    .time-filters-wrapper { justify-content: flex-start; }
    .search-filters-row { flex-wrap: wrap; max-width: 100%; }
}
