/* ===================================
   WP Encuestas Avanzadas - Estilos
   =================================== */

.wp-encuesta-container {
    max-width: 100%;
    margin: 30px auto;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wp-encuesta-titulo {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* Notificaciones */
.wp-encuesta-notice {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 14px;
}

.wp-encuesta-expired {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.wp-encuesta-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
}

/* Formulario de votación */
.wp-encuesta-form {
    width: 100%;
}

.wp-encuesta-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* Opciones con imágenes */
.wp-encuesta-form.with-images .wp-encuesta-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.wp-encuesta-option {
    position: relative;
    cursor: pointer;
    margin: 0;
    display: block;
}

.wp-encuesta-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wp-encuesta-option-content {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.wp-encuesta-form.with-images .wp-encuesta-option-content {
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

.wp-encuesta-option:hover .wp-encuesta-option-content {
    border-color: #2271b1;
    background: #f0f6fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.15);
}

.wp-encuesta-option input[type="radio"]:checked ~ .wp-encuesta-option-content {
    border-color: #2271b1;
    background: #e7f3ff;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.2);
}

.wp-encuesta-option input[type="radio"]:focus ~ .wp-encuesta-option-content {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.wp-encuesta-option-image {
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 6px;
}

.wp-encuesta-form.without-images .wp-encuesta-option-image {
    display: none;
}

.wp-encuesta-option-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
    object-fit: cover;
}

.wp-encuesta-option-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.wp-encuesta-form.without-images .wp-encuesta-option-text {
    padding-left: 30px;
    position: relative;
}

.wp-encuesta-form.without-images .wp-encuesta-option-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 50%;
    background: #fff;
}

.wp-encuesta-option input[type="radio"]:checked ~ .wp-encuesta-option-content .wp-encuesta-option-text::before {
    border-color: #2271b1;
    background: #2271b1;
    box-shadow: inset 0 0 0 3px #fff;
}

/* Fecha límite */
.wp-encuesta-deadline {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

/* Botón de envío */
.wp-encuesta-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wp-encuesta-submit:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.wp-encuesta-submit:active {
    transform: translateY(0);
}

.wp-encuesta-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Mensajes */
.wp-encuesta-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.wp-encuesta-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
    display: block;
}

.wp-encuesta-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
    display: block;
}

/* Resultados */
.wp-encuesta-results {
    width: 100%;
}

.wp-encuesta-total-votes {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
}

.wp-encuesta-result-item {
    margin-bottom: 20px;
}

.wp-encuesta-result-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.wp-encuesta-result-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.wp-encuesta-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wp-encuesta-result-text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.wp-encuesta-result-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    flex-shrink: 0;
}

.wp-encuesta-percentage {
    font-weight: 600;
    color: #2271b1;
    font-size: 18px;
}

.wp-encuesta-votes {
    color: #666;
}

.wp-encuesta-result-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.wp-encuesta-result-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    border-radius: 6px;
    transition: width 0.6s ease;
}

/* Compartir en redes sociales */
.wp-encuesta-social-share {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.wp-encuesta-share-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.wp-encuesta-share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.wp-encuesta-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
}

.wp-encuesta-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.wp-encuesta-share-facebook {
    background: #1877f2;
}

.wp-encuesta-share-facebook:hover {
    background: #145dbf;
}

.wp-encuesta-share-twitter {
    background: #1da1f2;
}

.wp-encuesta-share-twitter:hover {
    background: #0c85d0;
}

.wp-encuesta-share-whatsapp {
    background: #25d366;
}

.wp-encuesta-share-whatsapp:hover {
    background: #1eae54;
}

.wp-encuesta-share-linkedin {
    background: #0a66c2;
}

.wp-encuesta-share-linkedin:hover {
    background: #084d94;
}

.wp-encuesta-share-btn svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-encuesta-container {
        padding: 20px;
        margin: 20px 0;
    }
    
    .wp-encuesta-titulo {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .wp-encuesta-form.with-images .wp-encuesta-options {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .wp-encuesta-result-header {
        flex-wrap: wrap;
    }
    
    .wp-encuesta-result-stats {
        width: 100%;
        justify-content: flex-end;
    }
    
    .wp-encuesta-share-buttons {
        flex-direction: column;
    }
    
    .wp-encuesta-share-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wp-encuesta-form.with-images .wp-encuesta-options {
        grid-template-columns: 1fr;
    }
    
    .wp-encuesta-result-image {
        width: 50px;
        height: 50px;
    }
}

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

.wp-encuesta-results,
.wp-encuesta-social-share {
    animation: fadeIn 0.5s ease;
}

/* Accesibilidad */
.wp-encuesta-option:focus-within .wp-encuesta-option-content {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}