/**
 * Estilos para Accessibility Voice Reader
 */

/* Botón flotante */
.avr-floating-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #0073aa;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9999;
    border: none;
}

.avr-floating-button:hover {
    background: #005177;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.avr-floating-button:focus {
    outline: 3px solid #4ca6ff;
    outline-offset: 3px;
}

.avr-floating-button:active {
    transform: scale(0.95);
}

/* Estados del botón */
.avr-floating-button.avr-reading {
    background: #46b450;
    animation: avr-pulse 2s infinite;
}

.avr-floating-button.avr-paused {
    background: #ffb900;
}

.avr-floating-button.avr-stopped {
    background: #0073aa;
}

/* Animación de pulsación para cuando está leyendo */
@keyframes avr-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(70, 180, 80, 0.5);
    }
}

/* Icono SVG */
.avr-floating-button svg {
    width: 28px;
    height: 28px;
}

/* Notificaciones */
.avr-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #23282d;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    max-width: 300px;
}

.avr-notification.avr-show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive - móvil */
@media (max-width: 768px) {
    .avr-floating-button {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    
    .avr-floating-button svg {
        width: 24px;
        height: 24px;
    }
    
    .avr-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* Accesibilidad - alto contraste */
@media (prefers-contrast: high) {
    .avr-floating-button {
        border: 2px solid #ffffff;
    }
    
    .avr-floating-button:focus {
        outline-width: 4px;
    }
}

/* Accesibilidad - reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .avr-floating-button,
    .avr-notification {
        transition: none;
        animation: none;
    }
    
    .avr-floating-button:hover {
        transform: none;
    }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .avr-notification {
        background: #1e1e1e;
        border: 1px solid #3e3e3e;
    }
}

/* Asegurar que el botón no interfiera con otros elementos */
.avr-floating-button {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Indicador de progreso circular */
.avr-floating-button::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.avr-floating-button.avr-reading::before {
    border-top-color: #46b450;
    animation: avr-rotate 1s linear infinite;
}

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

/* Estilos para shortcode */
.avr-shortcode-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    text-decoration: none;
}

.avr-shortcode-button:hover {
    background: #005177;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.avr-shortcode-button:focus {
    outline: 3px solid #4ca6ff;
    outline-offset: 2px;
}

.avr-shortcode-button svg {
    width: 20px;
    height: 20px;
}

/* Estilo de enlace */
.avr-shortcode-button.avr-link-style {
    background: transparent;
    color: #0073aa;
    padding: 5px 10px;
    text-decoration: underline;
}

.avr-shortcode-button.avr-link-style:hover {
    color: #005177;
    background: rgba(0, 115, 170, 0.1);
    transform: none;
    box-shadow: none;
}

/* Estilo solo icono */
.avr-shortcode-button.avr-icon-style {
    padding: 12px;
    border-radius: 50%;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

.avr-shortcode-button.avr-icon-style span {
    display: none;
}

/* Widget styles */
.widget_avr_widget {
    padding: 15px;
}

.widget_avr_widget .avr-shortcode-button {
    width: 100%;
    justify-content: center;
}

/* Indicador de carga */
.avr-loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 30px;
    border-radius: 8px;
    z-index: 10001;
    display: none;
    align-items: center;
    gap: 15px;
}

.avr-loading-indicator.avr-show {
    display: flex;
}

.avr-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: avr-rotate 0.8s linear infinite;
}

/* Barra de progreso para lectura */
.avr-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #46b450, #00a32a);
    z-index: 10000;
    transition: width 0.3s ease;
    display: none;
}

.avr-progress-bar.avr-show {
    display: block;
}

/* Accesibilidad mejorada */
.avr-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
