/* =========================================
   UI POLISH: Overrides for Global Consistency
   ========================================= */

/* 1. Force white background on all Bootstrap-Select combos and standard selects */
select.form-control,
.bootstrap-select .btn.dropdown-toggle,
.bootstrap-select .btn.dropdown-toggle:active,
.bootstrap-select .btn.dropdown-toggle:focus {
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    height: 42px !important;
    opacity: 1 !important;
}

.bootstrap-select .btn.dropdown-toggle:hover {
    border-color: #635bff !important;
    background-color: #f8fafc !important;
}

/* 2. Premium White Button (Missing in previous theme) */
.btn-white {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.btn-white:hover {
    background-color: #f8fafc !important;
    border-color: #635bff !important;
    color: #635bff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* 3. Global focus states for all interactive elements */
.form-control:focus,
.bootstrap-select .btn.dropdown-toggle:focus {
    border-color: #635bff !important;
    box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1) !important;
    outline: none !important;
}


/* 4. Ensure labels in stripe-form-group have consistent spacing */
.stripe-form-group label {
    font-size: 13px;
    margin-bottom: 6px;
    color: #475569;
}

/* 5. MOBILE OPTIMIZATIONS */
@media (max-width: 1080px) {
    .stripe-card {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }

    .stripe-stat-value {
        font-size: 20px !important;
    }

    /* Mejora de tablas en móvil */
    .table-responsive {
        border: none !important;
    }

    table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,
    table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before {
        background-color: #635bff !important;
    }

    /* Forzar que las tablas no rompan el layout */
    .stripe-table {
        width: 100% !important;
    }

    .content-wrapper {
        padding-top: 10px !important;
    }

    /* FORZAR SCROLL EN MODALES LARGOS (COMO FINALIZAR INSTALACIÓN) */
    .modal {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .modal-open {
        overflow: hidden !important;
    }

    .modal-dialog {
        margin: 10px !important;
        width: auto !important;
    }

    .modal-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .modal-body {
        max-height: none !important;
        overflow: visible !important;
    }

    /* Compactar grupos de formulario en móvil */
    .stripe-form-group {
        margin-bottom: 12px !important;
    }
}

/* =========================================
   GLOBAL OCR TOGGLE & FINTECH SWITCH
   ========================================= */

.ocr-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(99, 102, 241, 0.05);
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.ocr-toggle-container:hover {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.ocr-toggle-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ocr-toggle-info i {
    font-size: 1.5em;
    color: #6366f1;
}

.ocr-toggle-text b {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.ocr-toggle-text span {
    color: #64748b;
    font-size: 11px;
}

/* The switch */
.fintech-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.fintech-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fintech-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.fintech-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.fintech-slider {
    background-color: #6366f1;
}

input:focus+.fintech-slider {
    box-shadow: 0 0 1px #6366f1;
}

input:checked+.fintech-slider:before {
    transform: translateX(24px);
}

/* =========================================
   PREMIUM NOTIFICATIONS (ALERTS)
   ========================================= */

.premium-alert {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    padding: 15px 20px !important;
    margin-bottom: 20px !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.premium-alert h4 {
    margin-top: 0 !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    font-size: 18px !important;
}

.premium-alert p {
    margin-bottom: 0 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.premium-alert .close {
    opacity: 0.5 !important;
    transition: opacity 0.2s !important;
    color: inherit !important;
}

.premium-alert .close:hover {
    opacity: 1 !important;
}

/* Success: Soft Green */
.premium-alert-success {
    background: #f0fdf4 !important;
    color: #166534 !important;
}

/* Danger: Soft Red */
.premium-alert-danger {
    background: #fef2f2 !important;
    color: #991b1b !important;
}

/* Warning: Soft Amber */
.premium-alert-warning {
    background: #fffbeb !important;
    color: #92400e !important;
}

/* Info: Soft Blue */
.premium-alert-info {
    background: #eff6ff !important;
    color: #1e40af !important;
}

/* Gradient/Highlight: Purple-Indigo Path */
.premium-alert-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    color: white !important;
}

.premium-alert-gradient .close {
    color: white !important;
    text-shadow: none !important;
}

.premium-alert-gradient .trophy-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 80px;
    opacity: 0.1;
    transform: rotate(15deg);
}

/* Animations */
.premium-alert-pulse {
    animation: alertPulse 2s infinite;
}

@keyframes alertPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}