/**
 * Estilos para el generador de vouchers
 */

/* Botón de descarga de voucher */
.woocommerce-button.aftin-download-voucher-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.woocommerce-button.aftin-download-voucher-btn:hover {
    background-color: #c0392b;
    color: white;
    text-decoration: none;
}

.woocommerce-button.aftin-download-voucher-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Icono para el botón */
.woocommerce-button.aftin-download-voucher-btn::before {
    content: "📄";
    margin-right: 5px;
}

/* Estados del botón */
.woocommerce-button.aftin-download-voucher-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.woocommerce-button.aftin-download-voucher-btn.loading::before {
    content: "⏳";
    animation: pulse 1s infinite;
}

/* Animación de pulsación */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Notificaciones */
.aftin-notification {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Overlay de carga */
#aftin-voucher-loading {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#aftin-voucher-loading div {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Estilos para la tabla de órdenes */
.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions {
    white-space: nowrap;
}

.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions .woocommerce-button {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .woocommerce-button.aftin-download-voucher-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .aftin-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Mejoras para accesibilidad */
.woocommerce-button.aftin-download-voucher-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Estados adicionales */
.woocommerce-button.aftin-download-voucher-btn.success {
    background-color: #27ae60;
}

.woocommerce-button.aftin-download-voucher-btn.success::before {
    content: "✓";
}

.woocommerce-button.aftin-download-voucher-btn.error {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.woocommerce-button.aftin-download-voucher-btn.error::before {
    content: "⚠";
}

/* Tooltips simples */
.woocommerce-button.aftin-download-voucher-btn[title] {
    position: relative;
}

.woocommerce-button.aftin-download-voucher-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Indicador de progreso */
.aftin-progress-bar {
    width: 100%;
    height: 4px;
    background-color: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.aftin-progress-bar::before {
    content: '';
    display: block;
    height: 100%;
    background-color: #3498db;
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 75%;
        margin-left: 0%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Loader */ 
.loader {
    height: 5px;
    width: 1px;
    position: absolute;
    animation: rotate0234 2s linear infinite;
}

.loader .dot {
    top: 30px;
    height: 7px;
    width: 7px;
    background: #ff5702;
    border-radius: 50%;
    position: relative;
}

.text {
    position: absolute;
    bottom: -85px;
    font-size: 25px;
    font-weight: 400;
    color: #26aee4;
}

@keyframes rotate0234 {
    30% {
        transform: rotate(220deg);
    }

    40% {
        transform: rotate(450deg);
        opacity: 1;
    }

    75% {
        transform: rotate(720deg);
        opacity: 1;
    }

    76% {
        opacity: 0;
    }

    100% {
        opacity: 0;
        transform: rotate(0deg);
    }
}

.loader:nth-child(1) {
    animation-delay: 0.15s;
}

.loader:nth-child(2) {
    animation-delay: 0.3s;
}

.loader:nth-child(3) {
    animation-delay: 0.45s;
}

.loader:nth-child(4) {
    animation-delay: 0.6s;
}

.loader:nth-child(5) {
    animation-delay: 0.75s;
}

.loader:nth-child(6) {
    animation-delay: 0.9s;
} 