body {
    font-family: Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
}
header {
    background: #1a237e;
    color: #fff;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: nowrap;
    gap: 1rem;
    padding: 0 1rem;
}

.header-content h1 {
    flex: 1;
    text-align: center;
    margin: 0;
    min-width: 300px;
}

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

.flag-brasil {
    height: 40px;
    width: auto;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.1);
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
}

.version-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: bold;
}

.version-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Tab Navigation with Pull Effect */
.turno-nav-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem 0.5rem 1rem;
    background: linear-gradient(to bottom, #f9f9f9, #f5f5f5);
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.turno-nav-bar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #e0e0e0 0%, #1a237e 50%, #e0e0e0 100%);
}

.turno-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
}

.turno-btn {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border: 1px solid #d0d0d0;
    border-bottom: 2px solid #c0c0c0;
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #666;
    font-size: 0.95rem;
    position: relative;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    transform: translateY(0px);
}

.turno-btn:hover:not(.ativo) {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border-color: #b0b0b0;
    transform: translateY(-2px);
    box-shadow: 0 -4px 8px rgba(0,0,0,0.1);
}

.turno-btn.ativo {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: #fff;
    border-color: #1a237e;
    border-bottom-color: transparent;
    box-shadow: 0 -4px 12px rgba(26, 35, 126, 0.3), 0 4px 0 0 #fff;
    transform: translateY(-4px);
    z-index: 10;
}

.turno-btn:focus-visible {
    outline: 2px solid rgba(26,35,126,0.6);
    outline-offset: 2px;
}

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

.turno-btn {
    animation: slideIn 0.4s ease-out;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #1a237e;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    overflow-y: auto;
    padding: 1.5rem;
}

.changelog-version {
    margin-bottom: 2rem;
}

.changelog-version h3 {
    margin: 0 0 0.5rem 0;
    color: #1a237e;
    font-size: 1.1rem;
}

.changelog-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.changelog-notes {
    list-style-position: inside;
    padding-left: 0;
}

.changelog-notes li {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.95rem;
}

main {
    max-width: 100vw;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 768px) {
    main {
        margin: 1rem auto;
        padding: 1rem;
    }
}

/* Gráfico Sections with Smooth Transitions */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutToLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#grafico {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideInFromLeft 0.5s ease-out;
    transition: all 0.3s ease-out;
}

#grafico-segundo {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideInFromRight 0.5s ease-out;
    transition: all 0.3s ease-out;
}

.hidden {
    display: none !important;
    animation: slideOutToLeft 0.3s ease-in forwards;
}

#grafico-wrapper-segundo {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

#media-final-box-segundo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: 2px solid #1a237e;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 220px;
    z-index: 10;
}

#media-final-box-segundo h3 {
    margin: 0 0 0.75rem 0;
    color: #1a237e;
    font-size: 0.9rem;
    text-transform: uppercase;
}

#media-final-items-segundo .media-item {
    display: grid;
    grid-template-columns: 15px 1fr auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

#media-final-items-segundo .media-item:last-child {
    border-bottom: none;
}

#media-final-items-segundo .media-item-name {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

#media-final-items-segundo .media-item-valor {
    font-weight: bold;
    text-align: right;
    white-space: nowrap;
}

#timeline-container-segundo {
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#timeline-container-segundo > label {
    font-weight: bold;
    color: #333;
    min-width: 100px;
}

#timeline-wrapper-segundo {
    flex: 1;
    min-width: 250px;
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
}

#timeline-track-segundo {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    pointer-events: none;
}

#timeline-label-segundo {
    font-weight: bold;
    color: #1a237e;
    min-width: 250px;
    text-align: right;
}

#candidatos-filtro {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
}

@media (max-width: 480px) {
    #candidatos-filtro {
        gap: 0.5rem;
        padding: 0.5rem;
    }
}

#candidatos-filtro label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

#candidatos-filtro input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

#grafico-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

#media-final-box {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border: 2px solid #1a237e;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 220px;
    z-index: 10;
}

#media-final-box h3 {
    margin: 0 0 0.75rem 0;
    color: #1a237e;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.media-item {
    display: grid;
    grid-template-columns: 15px 1fr auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.media-item:last-child {
    border-bottom: none;
}

.media-item-name {
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.media-item-valor {
    font-weight: bold;
    text-align: right;
    white-space: nowrap;
}

#graficoVotos {
    width: 100% !important;
    height: auto !important;
    max-width: 1200px;
    max-height: 600px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#graficoVotosSegundo {
    width: 100% !important;
    height: auto !important;
    max-width: 1200px;
    max-height: 600px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 1024px) {
    #graficoVotos {
        max-height: 500px;
    }
    
    #graficoVotosSegundo {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    #graficoVotos {
        max-height: 400px;
    }
    
    #graficoVotosSegundo {
        max-height: 400px;
    }
    
    #media-final-box {
        display: none;
    }
    
    #media-final-box-segundo {
        display: none;
    }
}

@media (max-width: 480px) {
    #graficoVotos {
        max-height: 300px;
    }
    
    #graficoVotosSegundo {
        max-height: 300px;
    }
}
h2 {
    color: #1a237e;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    display: none;
}

.turno-nav-inline {
    display: flex;
    gap: 1.5rem;
    margin: 0 0 1rem 0;
    padding: 0;
    background: transparent;
    white-space: nowrap;
    justify-content: center;
    align-items: center;
}

.turno-nav-inline .toggle-label {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 0.85rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    display: none;
}

.toggle-checkbox + span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border: 1px solid #d0d0d0;
    border-bottom: 2px solid #c0c0c0;
    border-radius: 8px 8px 0 0;
    font-size: 0.95rem;
    color: #666;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    user-select: none;
}

.toggle-checkbox + span::before {
    display: none;
}

.toggle-checkbox:checked + span::before {
    display: none;
}


.toggle-label:hover .toggle-checkbox:checked + span {
    box-shadow: 0 6px 16px rgba(26, 35, 126, 0.4);
}

.toggle-checkbox:checked + span {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border-color: #1a237e;
    border-bottom-color: transparent;
    color: #fff;
    box-shadow: 0 -4px 12px rgba(26, 35, 126, 0.3), 0 4px 0 0 #fff;
    transform: translateY(-4px);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
th, td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}
th {
    background: #e3e6fd;
}

#timeline-container {
    width: 100%;
    max-width: 1200px;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#timeline-container > label {
    font-weight: bold;
    color: #333;
    min-width: 100px;
}

#timeline-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
}

#timeline-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    pointer-events: none;
}

.timeline-input {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 12px;
    background: none;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    z-index: 5;
    accent-color: #1565c0 !important;
}

.timeline-input::-webkit-slider-track {
    background: #ddd !important;
    height: 6px;
    border-radius: 3px;
}

.timeline-input::-moz-range-track {
    background: #ddd !important;
    height: 6px;
    border-radius: 3px;
}

.timeline-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #1565c0;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: auto;
    z-index: 5;
}

.timeline-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #1565c0;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    pointer-events: auto;
    z-index: 5;
}

#timeline-label {
    font-weight: bold;
    color: #1a237e;
    min-width: 250px;
    text-align: right;
}

@media (max-width: 768px) {
    #timeline-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #timeline-wrapper {
        width: 100%;
    }
    
    #timeline-label {
        width: 100%;
        text-align: left;
    }
    
    #timeline-container-segundo {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    #timeline-wrapper-segundo {
        width: 100%;
    }
    
    #timeline-label-segundo {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 480px) {
    #timeline-container {
        padding: 1rem 0.5rem;
    }
    
    #timeline-container > label {
        min-width: auto;
    }
    
    #timeline-wrapper {
        height: 40px;
    }
    
    #timeline-container-segundo {
        padding: 1rem 0.5rem;
    }
    
    #timeline-container-segundo > label {
        min-width: auto;
    }
    
    #timeline-wrapper-segundo {
        height: 40px;
    }
    
    .timeline-input {
        top: 16px;
    }
    
    .timeline-input::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    
    .timeline-input::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
    
    #timeline-label {
        font-size: 0.85rem;
    }
}

/* Dark Mode */
body.dark-mode {
    background: #1a1a1a;
}

body.dark-mode header {
    background: #0d0d0d;
}

body.dark-mode main {
    background: #2a2a2a;
    color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

body.dark-mode .turno-nav-bar {
    background: #333;
    border-bottom-color: #444;
}

body.dark-mode h2,
body.dark-mode h3,
body.dark-mode label {
    color: #e0e0e0;
}

body.dark-mode #graficoVotos {
    background: #1e1e1e;
}

body.dark-mode #graficoVotosSegundo {
    background: #1e1e1e;
}

body.dark-mode #timeline-container {
    background: #333;
    color: #e0e0e0;
}

body.dark-mode #timeline-container-segundo {
    background: #333;
    color: #e0e0e0;
}

body.dark-mode .timeline-input {
    background: #444;
}

body.dark-mode .toggle-btn {
    color: #fff;
}

body.dark-mode #media-final-box {
    background: #2a2a2a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode #media-final-box h3 {
    color: #b0b0b0;
}

body.dark-mode #media-final-box-segundo {
    background: #2a2a2a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode #media-final-box-segundo h3 {
    color: #b0b0b0;
}

body.dark-mode .media-item {
    border-bottom-color: #444;
}

body.dark-mode .media-item-name {
    color: #e0e0e0;
}

body.dark-mode #media-final-items-segundo .media-item-name {
    color: #e0e0e0;
}

body.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-bottom-color: #444;
}

body.dark-mode .modal-header h2 {
    color: #e0e0e0;
}

body.dark-mode .modal-close {
    color: #aaa;
}

body.dark-mode .modal-close:hover {
    color: #fff;
}

body.dark-mode .changelog-version h3 {
    color: #b0b0b0;
}

body.dark-mode .changelog-date {
    color: #666;
}

body.dark-mode .changelog-notes li {
    color: #c0c0c0;
}

/* Estilos para Modal de Orientação */
.orientation-content {
    max-width: 400px;
    text-align: center;
}

.orientation-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.orientation-body p {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

.orientation-icon {
    font-size: 4rem;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orientation-hint {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
}

.close-orientation-btn {
    padding: 0.75rem 2rem;
    background: #1a237e;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.close-orientation-btn:hover {
    background: #0d1b5e;
}

body.dark-mode .orientation-body p {
    color: #e0e0e0;
}

body.dark-mode .orientation-hint {
    color: #999;
}

body.dark-mode .close-orientation-btn {
    background: #2196F3;
}

body.dark-mode .close-orientation-btn:hover {
    background: #1976D2;
}
