/* ===== ESTILOS PRINCIPALES ELECCIONES.CL v3.4.1 ===== */
.elecciones-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ===== MATCH ELECTORAL ===== */
#elecciones-match .match-container {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    border-radius: 16px;
    padding: 30px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.3);
    position: relative;
    overflow: hidden;
}

#elecciones-match .match-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
}

#elecciones-match .quiz-header {
    text-align: center;
    margin-bottom: 25px;
}

#elecciones-match .quiz-header h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 800;
    color: #ffffff;
}

#elecciones-match .quiz-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 5px;
}

#elecciones-match .progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
}

#elecciones-match .progress-bar {
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    height: 10px;
    margin: 15px 0;
    overflow: hidden;
}

#elecciones-match .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 8px;
    transition: width 0.5s ease;
}

#elecciones-match .quiz-options {
    display: grid;
    gap: 12px;
    margin: 25px 0;
}

#elecciones-match .quiz-option {
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 18px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 1rem;
    line-height: 1.4;
    color: #ffffff;
}

#elecciones-match .quiz-option:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

#elecciones-match .quiz-option.selected {
    background: rgba(255,255,255,0.2);
    border-color: #10b981;
    transform: translateY(-2px);
}

#elecciones-match .option-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

#elecciones-match .option-letter {
    font-size: 1.2rem;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

#elecciones-match .quiz-option.selected .option-letter {
    background: #10b981;
    color: white;
}

#elecciones-match .option-text {
    flex: 1;
}

#elecciones-match .question-text {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.3;
    color: #ffffff;
}

#elecciones-match .question-eje {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 6px;
    color: #a5b4fc;
}

#elecciones-match .results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

#elecciones-match .result-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    color: #1f2937;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

#elecciones-match .result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
    opacity: 0.8;
}

#elecciones-match .result-card.winner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 3px solid #34d399;
    transform: scale(1.02);
}

#elecciones-match .result-card.winner::before {
    background: #ffffff;
}

#elecciones-match .result-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

#elecciones-match .result-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid currentColor;
    margin-right: 25px;
    object-fit: cover;
}

#elecciones-match .result-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: inherit;
}

#elecciones-match .result-info p {
    margin: 0 0 12px 0;
    opacity: 0.9;
    font-size: 1.1rem;
    color: inherit;
}

#elecciones-match .result-percentage {
    font-size: 2.5rem;
    font-weight: bold;
    color: inherit;
}

#elecciones-match .result-details {
    background: rgba(0,0,0,0.05);
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    color: inherit;
}

#elecciones-match .result-card.winner .result-details {
    background: rgba(255,255,255,0.2);
    color: white;
}

#elecciones-match .share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

#elecciones-match .results-title {
    text-align: center;
    margin-bottom: 25px;
}

#elecciones-match .results-title h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 800;
    color: #ffffff;
}

#elecciones-match .results-title p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #ffffff;
}

/* ===== COMPARADOR MEJORADO ===== */
#elecciones-comparador .comparador-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(30, 41, 59, 0.1);
    border: 1px solid #e2e8f0;
}

#elecciones-comparador h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 8px;
    color: #1e293b;
    font-weight: 800;
}

#elecciones-comparador .subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Checkbox para seleccionar todos */
#elecciones-comparador .candidates-select-all {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    text-align: center;
}

#elecciones-comparador .candidates-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

#elecciones-comparador .candidate-card {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
    position: relative;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#elecciones-comparador .candidate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#elecciones-comparador .candidate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: currentColor;
}

#elecciones-comparador .candidate-card:hover::before {
    opacity: 1;
}

#elecciones-comparador .candidate-card.selected {
    border-color: currentColor;
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

#elecciones-comparador .candidate-card.selected::before {
    opacity: 1;
}

#elecciones-comparador .candidate-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 5px solid currentColor;
    object-fit: cover;
    transition: all 0.3s ease;
}

#elecciones-comparador .candidate-card:hover img {
    transform: scale(1.08);
}

#elecciones-comparador .candidate-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

#elecciones-comparador .candidate-card p {
    margin: 0;
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

#elecciones-comparador .eje-filters {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

#elecciones-comparador .eje-filters h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 600;
    text-align: center;
}

#elecciones-comparador .filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

#elecciones-comparador .filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

#elecciones-comparador .filter-checkbox:hover {
    background: rgba(59, 130, 246, 0.05);
}

#elecciones-comparador .filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#elecciones-comparador .filter-checkbox span {
    color: #475569;
    font-weight: 500;
}

#elecciones-comparador .filter-checkbox input:checked + span {
    color: #1e293b;
    font-weight: 600;
}

#elecciones-comparador .comparison-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

#elecciones-comparador .comparison-header h3 {
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
    margin: 0;
}

#elecciones-comparador .eje-comparison {
    margin-bottom: 30px;
}

#elecciones-comparador .eje-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    color: #1e293b;
}

#elecciones-comparador .propuestas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

#elecciones-comparador .propuesta-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    transition: all 0.3s ease;
    border-left: 4px solid currentColor;
    position: relative;
}

#elecciones-comparador .propuesta-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#elecciones-comparador .propuesta-card .candidate-name {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

#elecciones-comparador .candidate-name-full {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 500;
}

#elecciones-comparador .candidate-description {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #475569;
    margin-bottom: 15px;
}

#elecciones-comparador .candidate-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* CORRECCIÓN ESPECÍFICA PARA BOTONES HOVER */
#elecciones-comparador .action-btn {
    background: transparent;
    border: 1px solid currentColor;
    color: currentColor;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

#elecciones-comparador .action-btn:hover {
    background: currentColor;
    color: white !important;
    transform: translateY(-1px);
}

/* Fuerza el color blanco en el texto del botón al hacer hover */
#elecciones-comparador .action-btn:hover,
#elecciones-comparador .action-btn:hover * {
    color: white !important;
}

/* BOTÓN FLOTANTE PARA MÓVIL */
.floating-compare-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: float 3s ease-in-out infinite;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.floating-compare-btn .elecciones-btn {
    background: transparent;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
}

/* ===== CHAT MEJORADO ===== */
#elecciones-chat .chat-container {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 16px;
    padding: 30px;
    color: white;
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

#elecciones-chat .chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #3b82f6, #8b5cf6);
}

#elecciones-chat h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 800;
    color: #ffffff;
}

#elecciones-chat .subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
    font-weight: 500;
}

/* CORRECCIÓN: Scrollbar SIEMPRE VISIBLE para el selector de candidatos */
#elecciones-chat .candidate-selector {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 20px 0;
    margin-bottom: 25px;
    scrollbar-width: thick;
    scrollbar-color: #fbbf24 #1e293b;
}

/* CORRECCIÓN: Scrollbar SIEMPRE VISIBLE para Webkit */
#elecciones-chat .candidate-selector::-webkit-scrollbar {
    height: 18px;
    background-color: #1e293b;
    border-radius: 10px;
    border: 3px solid #4f46e5;
}

#elecciones-chat .candidate-selector::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 10px;
    border: 3px solid #1e293b;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
    opacity: 1;
    visibility: visible;
}

#elecciones-chat .candidate-selector::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 15px rgba(251, 191, 36, 1);
}

#elecciones-chat .candidate-selector::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 10px;
    border: 3px solid #4f46e5;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

/* Asegurar que la scrollbar sea visible incluso sin hover */
#elecciones-chat .candidate-selector {
    scrollbar-color: #fbbf24 #1e293b !important;
}

#elecciones-chat .candidate-selector::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#elecciones-chat .chat-candidate {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    color: #ffffff;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

#elecciones-chat .chat-candidate:hover {
    border-color: currentColor;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.15);
}

#elecciones-chat .chat-candidate.active {
    border-color: currentColor;
    background: rgba(16, 185, 129, 0.3);
    transform: translateY(-3px);
}

#elecciones-chat .chat-candidate img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 4px solid currentColor;
    object-fit: cover;
    transition: all 0.3s ease;
}

#elecciones-chat .chat-candidate:hover img {
    transform: scale(1.08);
}

#elecciones-chat .chat-candidate span {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
}

#elecciones-chat .chat-box {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
}

#elecciones-chat .chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    scrollbar-width: thin;
}

#elecciones-chat .chat-messages::-webkit-scrollbar {
    width: 6px;
}

#elecciones-chat .chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#elecciones-chat .chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#elecciones-chat .message {
    margin-bottom: 15px;
    display: flex;
}

#elecciones-chat .message.user {
    justify-content: flex-end;
}

#elecciones-chat .message.bot {
    justify-content: flex-start;
}

#elecciones-chat .message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

#elecciones-chat .message.user .message-bubble {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 4px;
}

#elecciones-chat .message.bot .message-bubble {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* MEJORA: Input de chat mejorado para móvil */
#elecciones-chat .chat-input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

#elecciones-chat .chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    max-height: 150px;
    padding: 12px 16px;
    line-height: 1.4;
}

#elecciones-chat .chat-input:focus {
    border-color: #3b82f6;
}

#elecciones-chat .send-button {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
    align-self: flex-end;
    min-width: 120px;
}

#elecciones-chat .send-button:hover:not(:disabled) {
    background: #2563eb;
}

#elecciones-chat .send-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ===== LIGHTBOX CORREGIDO ===== */
.elecciones-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.elecciones-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.elecciones-lightbox-content {
    background: white;
    border-radius: 16px;
    max-width: 90%;
    max-height: 90%;
    width: 600px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.elecciones-lightbox-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    color: white !important;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.elecciones-lightbox-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
}

.elecciones-lightbox-close {
    background: none;
    border: none;
    color: white !important;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.elecciones-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.elecciones-lightbox-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.elecciones-lightbox-eje {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.elecciones-lightbox-eje:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.elecciones-lightbox-eje h4 {
    color: #1e293b;
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.elecciones-lightbox-eje p {
    color: #475569;
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* ===== BOTONES GENERALES ===== */
.elecciones-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.elecciones-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.elecciones-btn.restart-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.elecciones-btn.restart-btn:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.elecciones-btn.whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.elecciones-btn.whatsapp-btn:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== ERRORES ===== */
.elecciones-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    #elecciones-comparador .candidates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .elecciones-container {
        padding: 15px;
    }
    
    #elecciones-match .match-container,
    #elecciones-comparador .comparador-container,
    #elecciones-chat .chat-container {
        padding: 20px;
        border-radius: 12px;
    }
    
    #elecciones-match .quiz-header h2,
    #elecciones-comparador h2,
    #elecciones-chat h2 {
        font-size: 1.6rem;
    }
    
    #elecciones-match .question-text {
        font-size: 1.1rem;
    }
    
    #elecciones-comparador .candidates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    #elecciones-comparador .candidate-card {
        padding: 25px 15px;
        min-height: 280px;
    }
    
    #elecciones-comparador .candidate-card img {
        width: 120px;
        height: 120px;
    }
    
    #elecciones-comparador .propuestas-grid {
        grid-template-columns: 1fr;
    }
    
    #elecciones-comparador .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    #elecciones-comparador .filter-checkbox {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    #elecciones-comparador .action-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    #elecciones-comparador .candidate-name {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    #elecciones-comparador .candidate-name-full {
        display: none;
    }
    
    #elecciones-comparador .propuesta-card {
        padding: 15px 12px;
    }
    
    #elecciones-comparador .candidate-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    #elecciones-comparador .action-btn {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
    }
    
    /* MEJORA: Chat responsive mejorado */
    #elecciones-chat .candidate-selector {
        gap: 10px;
        padding: 15px 0;
    }
    
    #elecciones-chat .chat-candidate {
        min-width: 100px;
        padding: 15px 10px;
    }
    
    #elecciones-chat .chat-candidate img {
        width: 70px;
        height: 70px;
    }
    
    #elecciones-chat .message-bubble {
        max-width: 85%;
    }
    
    /* CORRECCIÓN: Scrollbar aún más visible en móvil */
    #elecciones-chat .candidate-selector::-webkit-scrollbar {
        height: 20px;
        background-color: #1e293b;
        border: 3px solid #4f46e5;
    }
    
    #elecciones-chat .candidate-selector::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        border: 3px solid #1e293b;
        box-shadow: 0 0 15px rgba(251, 191, 36, 1);
    }
    
    #elecciones-chat .candidate-selector::-webkit-scrollbar-track {
        background: #1e293b;
        border: 3px solid #4f46e5;
        box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
    }
    
    /* MEJORA: Input de chat en móvil - botón debajo */
    #elecciones-chat .chat-input-container {
        flex-direction: column;
    }
    
    #elecciones-chat .chat-input {
        min-height: 100px;
        font-size: 16px;
    }
    
    #elecciones-chat .send-button {
        align-self: stretch;
        padding: 15px;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .elecciones-btn {
        width: 100%;
        max-width: 250px;
    }
    
    #elecciones-match .result-photo {
        width: 100px;
        height: 100px;
    }
    
    #elecciones-match .result-info h3 {
        font-size: 1.3rem;
    }
    
    #elecciones-match .result-percentage {
        font-size: 1.8rem;
    }
    
    .elecciones-lightbox-content {
        max-width: 95%;
        width: 95%;
    }
    
    .elecciones-lightbox-header {
        padding: 15px 20px;
    }
    
    .elecciones-lightbox-body {
        padding: 20px;
        max-height: 70vh;
    }
    
    .elecciones-lightbox-eje {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    /* Botón flotante en móvil */
    .floating-compare-btn {
        bottom: 20px;
    }
    
    .floating-compare-btn .elecciones-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .elecciones-container {
        padding: 10px;
    }
    
    #elecciones-comparador .candidates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    #elecciones-comparador .candidate-card {
        padding: 15px 8px;
        min-height: 240px;
    }
    
    #elecciones-comparador .candidate-card img {
        width: 80px;
        height: 80px;
    }
    
    #elecciones-comparador .candidate-card h3 {
        font-size: 1rem;
    }
    
    #elecciones-comparador .candidate-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    #elecciones-comparador .action-btn {
        width: 100%;
        text-align: center;
    }
    
    #elecciones-chat .candidate-selector {
        justify-content: flex-start;
    }
    
    /* CORRECCIÓN: Scrollbar máxima visibilidad en móvil pequeño */
    #elecciones-chat .candidate-selector::-webkit-scrollbar {
        height: 22px;
    }
    
    #elecciones-match .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    #elecciones-match .result-photo {
        margin-right: 0;
        margin-bottom: 15px;
        width: 90px;
        height: 90px;
    }
    
    #elecciones-comparador .candidate-card img {
        width: 100px;
        height: 100px;
    }
    
    #elecciones-chat .chat-candidate img {
        width: 60px;
        height: 60px;
    }
}

/* ===== MEJORAS DE USABILIDAD ===== */
#elecciones-match .quiz-stats {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #a5b4fc;
    margin-top: 5px;
}

#elecciones-match .results-stats {
    font-size: 0.9rem;
    opacity: 0.8;
    color: #a5b4fc;
    margin-top: 5px;
}

/* Botón WhatsApp en la parte superior */
.share-buttons-top {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.share-buttons-top .elecciones-btn {
    margin: 0;
}

/* Mejor contraste en resultados ganadores */
#elecciones-match .result-card.winner .result-info h3,
#elecciones-match .result-card.winner .result-info p,
#elecciones-match .result-card.winner .result-percentage,
#elecciones-match .result-card.winner .result-details {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

#elecciones-match .result-card.winner .result-details {
    background: rgba(255,255,255,0.25);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Espaciado mejorado */
#elecciones-match .results-title {
    text-align: center;
    margin-bottom: 20px;
}

#elecciones-match .results-title h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 800;
    color: #ffffff;
}

#elecciones-match .results-title p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: #ffffff;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}