/* Estilos para WooCommerce Amipass Gateway */

/* Formulario de pago Amipass */
#amipass-payment-form {
    margin: 15px 0;
}

.amipass-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.amipass-logo {
    text-align: center;
    margin-bottom: 20px;
}

.amipass-logo img {
    max-height: 50px;
    width: auto;
}

.amipass-steps h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.amipass-steps ol {
    margin: 0;
    padding-left: 20px;
    counter-reset: step-counter;
}

.amipass-steps ol li {
    margin: 8px 0;
    padding-left: 10px;
    position: relative;
    counter-increment: step-counter;
}

.amipass-steps ol li::before {
    content: counter(step-counter);
    position: absolute;
    left: -25px;
    top: 0;
    background: #007cba;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.amipass-security {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.amipass-security p {
    margin: 0;
    color: #28a745;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.amipass-security .dashicons {
    margin-right: 8px;
    font-size: 16px;
}

/* Loading spinner */
.amipass-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.amipass-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: amipass-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes amipass-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.amipass-loading p {
    margin: 0;
    font-size: 16px;
    text-align: center;
}

/* Estilos para campos de formulario */
.payment_method_amipass {
    position: relative;
}


/* Campo RUT personalizado */
#billing_rut_field {
    position: relative;
}

#billing_rut_field .description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Mensajes de error y éxito */
.woocommerce-message,
.woocommerce-error {
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    position: relative;
}

.woocommerce-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.woocommerce-message .dashicons,
.woocommerce-error .dashicons {
    margin-right: 8px;
    vertical-align: middle;
}

/* Página de recibo de orden */
.woocommerce-order-received .amipass-status {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.woocommerce-order-received .amipass-status.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.woocommerce-order-received .amipass-status.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .amipass-instructions {
        padding: 15px;
        margin: 10px 0;
    }
    
    .amipass-logo img {
        max-height: 40px;
    }
    
    .amipass-steps ol {
        padding-left: 15px;
    }
    
    .amipass-steps ol li {
        padding-left: 8px;
    }
    
    .amipass-steps ol li::before {
        left: -20px;
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
}

/* Estilos para admin */
.woocommerce_page_wc-settings .form-table td fieldset label {
    font-weight: normal;
}

.woocommerce_page_wc-settings .amipass-admin-notice {
    background: #fff3cd;
    border-left: 4px solid #ffeaa7;
    padding: 12px;
    margin: 15px 0;
}

/* Iconos de dashboard */
.dashicons-amipass:before {
    content: "💳";
}

/* Estados de transacción */
.amipass-transaction-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.amipass-transaction-status.pending {
    background: #fff3cd;
    color: #856404;
}

.amipass-transaction-status.approved {
    background: #d4edda;
    color: #155724;
}

.amipass-transaction-status.rejected {
    background: #f8d7da;
    color: #721c24;
}

.amipass-transaction-status.refunded {
    background: #d1ecf1;
    color: #0c5460;
}

/* Tabla de transacciones en admin */
.amipass-transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.amipass-transactions-table th,
.amipass-transactions-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.amipass-transactions-table th {
    background: #f1f1f1;
    font-weight: bold;
}

/* Botones de acción */
.amipass-action-buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.amipass-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: background-color 0.3s;
}

.amipass-btn-primary {
    background: #007cba;
    color: white;
}

.amipass-btn-primary:hover {
    background: #005a87;
    color: white;
}

.amipass-btn-secondary {
    background: #6c757d;
    color: white;
}

.amipass-btn-secondary:hover {
    background: #545b62;
    color: white;
}

.amipass-btn-danger {
    background: #dc3545;
    color: white;
}

.amipass-btn-danger:hover {
    background: #c82333;
    color: white;
}

/* Tooltips */
.amipass-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.amipass-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.amipass-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

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

.amipass-fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .amipass-instructions {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .amipass-steps h4 {
        color: #e2e8f0;
    }
    
    .amipass-security {
        border-top-color: #4a5568;
    }
}