/**
 * Diners Convenio Payment Gateway Stylesheet
 * Premium modern design for Checkout and Admin Dashboard.
 */

/* ==========================================================================
   FORMULARIO EN CHECKOUT (CLIENTE)
   ========================================================================== */

/* Contenedor del formulario Diners */
.diners-convenio-form {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px !important;
    margin-top: 15px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.diners-convenio-form:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* Campos de entrada */
.diners-convenio-form .dec-form-group {
    margin-bottom: 20px !important;
}

.diners-convenio-form label {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
    display: block;
}

.diners-convenio-form .dec-input {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    color: #334155 !important;
    font-size: 15px !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.diners-convenio-form .dec-input:focus {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1) !important;
}

/* Envoltura del input de tarjeta con icono */
.dec-input-wrapper {
    position: relative;
    display: block;
}

.dec-input-wrapper .dec-input {
    padding-right: 48px !important;
    font-family: monospace;
    letter-spacing: 1px;
}

.dec-card-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 24" width="36" height="24"><rect width="36" height="24" rx="3" fill="%230079C1"/><path d="M7.5 12c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z" fill="%23FFF" fill-opacity=".3"/><path d="M12 12c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z" fill="%23FFF" fill-opacity=".3"/><text x="18" y="16" font-family="sans-serif" font-size="7" font-weight="bold" fill="%23FFF" text-anchor="middle">Diners</text></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.8;
    pointer-events: none;
}

/* Checkbox de Autorización */
.dec-checkbox-group {
    margin-top: 10px;
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.dec-checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    cursor: pointer;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
}

.dec-checkbox {
    margin-top: 3px !important;
    margin-right: 10px !important;
    flex-shrink: 0;
}

.dec-checkbox-text {
    line-height: 1.4;
}

/* ==========================================================================
   TABLA DE ADMINISTRACIÓN (SHORTCODE)
   ========================================================================== */

/* Contenedor del listado */
.dec-orders-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    padding: 30px;
    margin: 25px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #334155;
}

/* Encabezado */
.dec-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f8fafc;
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.dec-orders-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.dec-badge {
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #dbeafe;
}

/* Tabla Envoltorio */
.dec-table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* Tabla Estilos */
.dec-orders-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

.dec-orders-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
}

.dec-orders-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.dec-order-row:last-child td {
    border-bottom: none;
}

.dec-order-row:hover {
    background-color: #f8fafc;
}

/* Celdas específicas */
.dec-cell-id a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.15s ease;
}

.dec-cell-id a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.dec-cell-date {
    color: #475569;
}

.dec-total-amount {
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.dec-subtext {
    color: #64748b;
    font-size: 12px;
}

.dec-meta-list {
    font-size: 13px;
}

.dec-meta-list div {
    margin-bottom: 4px;
}

.dec-meta-list div:last-child {
    margin-bottom: 0;
}

/* Celda de Tarjeta */
.dec-cell-card {
    font-family: monospace;
    font-size: 15px;
    letter-spacing: 1px;
    color: #334155;
    font-weight: 600;
}

.dec-masked-card-number {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

/* Botones de acción */
.dec-action-btn {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    outline: none;
    display: inline-block;
}

.dec-action-btn:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.dec-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.dec-action-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Botón estado "Revelado" */
.dec-btn-reveal.dec-state-revealed {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dec-btn-reveal.dec-state-revealed:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

/* Animación de número revelado */
.dec-btn-reveal.dec-state-revealed ~ .dec-masked-card-number,
.dec-state-revealed ~ .dec-masked-card-number,
td.dec-cell-card:has(.dec-state-revealed) .dec-masked-card-number, /* fallback CSS selector standard */
#dec-card-cell-wrapper-active {
    /* Agregamos una clase especial en el span si es necesario, o usando selector de JS */
}

/* Estilo para cuando la tarjeta está expuesta en plano */
.dec-cell-card .dec-masked-card-number:not(:contains('*')), /* Si ya no tiene asteriscos */
.dec-revealed-active {
    background: #fffbeb !important;
    color: #d97706 !important;
    border-color: #fde68a !important;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
    animation: dec-pulse 2s infinite;
}

@keyframes dec-pulse {
    0% {
        box-shadow: 0 0 0 0px rgba(251, 191, 36, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(251, 191, 36, 0);
    }
    100% {
        box-shadow: 0 0 0 0px rgba(251, 191, 36, 0);
    }
}

/* Mensajes de error o advertencia */
.dec-unauthorized {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
    color: #b91c1c;
    font-weight: 500;
    margin: 20px 0;
}

.dec-no-orders {
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    color: #64748b;
    margin: 20px 0;
}

/* Acciones en la cabecera y Botón Exportar */
.dec-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dec-btn-export {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    text-decoration: none !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    display: inline-flex;
    align-items: center;
}

.dec-btn-export:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.3) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}
