/* ===============================================
   UPLOAD.CSS - Componente de Zona de Subida
   =============================================== */

/* ===== SECCIÓN PRINCIPAL ===== */
.process-centers-section {
    padding: 2rem;
}

.upload-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    position: relative;
}

.upload-section:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ===== ANIMACIONES ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== DISEÑO COMPACTO MEJORADO ===== */

/* Mejora del formulario con espaciado optimizado */
.upload-section .row {
    align-items: stretch;
}

.upload-section .col-lg-2,
.upload-section .col-lg-6,
.upload-section .col-lg-4 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Form Elements Compacto */
.form-group-compact {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.form-label-compact {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.form-label-compact i {
    margin-right: 0.5rem;
    color: #6366f1;
    font-size: 0.875rem;
}

.input-group-compact {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.form-control-compact {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
    text-align: center;
    font-weight: 500;
    height: 48px;
    color: #374151;
}

.form-control-compact:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.form-control-compact.is-valid {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    color: #065f46;
}

.form-control-compact.is-invalid {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.input-loader-compact {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.feedback-compact {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.feedback-compact.error {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Upload Zone Compacto - Estado vacío */
.upload-zone-compact {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    text-align: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.upload-zone-compact:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.upload-zone-compact.dragover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border-style: solid;
    transform: scale(1.02);
}

/* Upload Content */
.upload-content-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.upload-icon-compact {
    font-size: 1.25rem;
    color: #6366f1;
}

.upload-text-compact {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Por defecto mostrar texto completo y ocultar texto mobile */
.upload-text-full {
    display: inline;
}

.upload-text-mobile {
    display: none;
}

.upload-specs-compact {
    font-size: 0.75rem;
    color: #6b7280;
}

/* File Card - Estado con archivo (éxito) */
.file-card-compact {
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    height: 48px;
    display: flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.05);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.file-card-compact:hover {
    border-color: #059669;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
    background: rgba(16, 185, 129, 0.08);
}

.file-info-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.file-details-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.file-icon-compact {
    font-size: 1.25rem;
    color: #10b981;
    flex-shrink: 0;
}

.file-text-compact {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.file-name-compact {
    font-weight: 600;
    font-size: 0.875rem;
    color: #065f46;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.file-size-compact {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    line-height: 1;
}

.btn-remove-compact {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.875rem;
    padding: 0.375rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-remove-compact:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

/* Loading indicator */
.upload-loader-compact {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    gap: 0.5rem;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Process Button Compacto */
.btn-process-compact {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 100%;
}

.btn-process-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.6s ease;
}

.btn-process-compact:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-process-compact:hover::before {
    left: 100%;
}

.btn-process-compact:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.btn-process-compact:disabled:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
    box-shadow: none;
}

/* Process Help */
.process-help-compact {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    text-align: center;
}

.process-help-compact small {
    font-weight: 500;
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.process-help-compact i {
    color: #6366f1;
    font-size: 0.875rem;
}

.process-help-compact i.fa-gift {
    color: #10b981; /* Verde para créditos gratuitos */
}

.process-help-compact i.fa-crown {
    color: #f59e0b; /* Amarillo dorado para créditos PRO */
}

/* Progress overlay: bloquea y se centra SOLO en el área de contenido (no sobre
   el sidebar ni la cabecera). Ancla en .content-wrapper (position: relative).
   z-index por DEBAJO del frame (sidebar ~1000, cabecera ~1020, botón flotante
   ~1050) para que el difuminado no tape el marco; y por encima del contenido
   (máx. ~20) al que sí debe cubrir. */
.progress-section:not(.hidden) {
    position: absolute;
    inset: 0;
    z-index: 800;
    /* !important: toggleSection()/_showDemoBusyUI() ponen display:block inline y
       romperían el centrado flex del overlay. */
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: linear-gradient(160deg, rgba(31,41,51,0.72) 0%, rgba(44,62,80,0.72) 100%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: progressFade 0.15s ease;
}
@keyframes progressFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes progressPop {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* Progress Card */
.progress-card-compact {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Dentro del overlay: tarjeta centrada, sin margen inferior */
.progress-section:not(.hidden) .progress-card-compact {
    width: 100%;
    max-width: 440px;
    margin: 0;
    text-align: center;
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.4);
    animation: progressPop 0.42s cubic-bezier(.2,.8,.2,1);
}
.progress-emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.4rem;
    animation: progressBob 1.6s ease-in-out infinite;
}
@keyframes progressBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.progress-fun {
    color: #1f2933;
    font-weight: 800;
    letter-spacing: -0.01em;
    min-height: 1.5em;
}
.progress-meta { font-size: 0.85rem; }
.progress-hint {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Modo "cargando" (rehidratación/arranque): overlay sin barra ni %, solo el
   emoji y el mensaje. Bloquea la pantalla igual que el de procesado. */
.progress-section.cargando .progress,
.progress-section.cargando .progress-meta,
.progress-section.cargando .progress-hint { display: none; }
.progress-section.cargando .progress-fun { margin-bottom: 0; }

/* La rehidratación al cambiar de sección suele ser instantánea (preview cacheado
   en window). Retrasamos la aparición del overlay ~0.22s: si la carga es rápida,
   NO llega a verse (nada de parpadeo); si es lenta (F5 en frío), aparece igual. */
.progress-section.cargando { animation: progressFade 0.25s ease 0.22s both; }

.progress-card-compact h5 {
    color: #374151;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.progress-card-compact .progress {
    height: 8px;
    border-radius: 4px;
    background: #f3f4f6;
    overflow: hidden;
}

.progress-card-compact .progress-bar {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.4s ease;
}

/* Nota del modo "nueva ubicación" (reutiliza el Excel ya subido) */
.reubicar-nota {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    background: #eef7ee;
    border: 1px solid #cfe6cf;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #2c3e50;
}
.reubicar-nota i { color: #3f7d3f; }

/* Barra "archivo actual" (persistencia): nombre del Excel + cargar nuevo */
.active-file-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
    padding: 0.6rem 0.9rem;
    background: #eef1ff;
    border: 1px solid #c7d0f5;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #2c3e50;
}
.active-file-bar__info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.active-file-bar__info i { color: #3f7d3f; }
.active-file-bar__info strong { word-break: break-all; }
.active-file-bar__acciones {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.active-file-bar__btn {
    border: 1px solid var(--focus-color, #667eea);
    background: #fff;
    color: #334155;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}
.active-file-bar__btn:hover { background: #f0f3ff; }

/* Results Card */
.results-card-compact {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.results-header-compact {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.results-header-compact h5 {
    color: #374151;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.results-header-compact p {
    color: #6b7280;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.btn-download-compact {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-download-compact:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

/* Estilos específicos según el modo de procesamiento */
.btn-download-compact.standard {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-download-compact.standard:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea97d 100%);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.btn-download-compact.premium {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.btn-download-compact.premium:hover {
    background: linear-gradient(135deg, #e0a800 0%, #e55a00 100%);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
}

/* Download buttons group */
.download-buttons-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.results-preview-compact {
    /* No additional styles needed, using Bootstrap table classes */
}

.preview-footer-compact {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.preview-footer-compact small {
    color: #6b7280;
    font-size: 0.8rem;
}

/* ===== ELEMENTOS OCULTOS PERO USADOS POR JS ===== */

/* Credit Mode Selector */
.credit-mode-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.credit-mode-toggle {
    display: flex;
    background: white;
    border-radius: 6px;
    padding: 0.25rem;
    border: 1px solid #dee2e6;
    gap: 0.25rem;
}

.mode-option {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.mode-option i {
    font-size: 1rem;
}

.mode-option.premium i {
    color: #ffc107;
}

.mode-option.standard i {
    color: #28a745;
}

.mode-option.active {
    background: #e9ecef;
    color: var(--text-primary);
    font-weight: 600;
}

.mode-option.active.premium {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.mode-option.active.premium i {
    color: #ffc107;
}

.mode-option.active.standard {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.mode-option.active.standard i {
    color: #28a745;
}

.mode-option:hover:not(.active) {
    background: #f8f9fa;
}

.credit-count {
    color: white;
    border-radius: 10px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.current-mode-info {
    flex: 1;
}

.mode-label {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.mode-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Process Description */
.process-description {
    margin-top: 1rem;
}

.description-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.description-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.description-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.description-icon.premium {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.description-icon i {
    font-size: 1.1rem;
}

.description-text h6 {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.description-text p {
    margin-bottom: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Action Buttons - Movidos a upload-modern.css para evitar duplicaciones */

/* Process Button Single */
.process-btn-single {
    /* Estado neutral por defecto - sin color específico hasta que se inicialice */
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    height: 44px;
}

.process-btn-single::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.process-btn-single:hover::before {
    left: 100%;
}

.process-btn-single.standard {
    /* Pizarra sobrio (paleta de marca): ni verde chillón ni morado. */
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    font-weight: 600;
}

.process-btn-single.standard:hover {
    background: linear-gradient(135deg, #3f4c5e 0%, #293548 100%);
    transform: translateY(-1px);
    font-weight: 700;
}

.process-btn-single.standard i {
    color: #fff;
}

.process-btn-single.premium {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    font-weight: 700;
}

.process-btn-single.premium:hover {
    background: linear-gradient(135deg, #e0a800 0%, #e55a00 100%);
    transform: translateY(-1px);
    font-weight: 800;
}

.process-btn-single.premium i.fa-coins {
    color: #212529; /* Negro/gris oscuro para que se vea sobre el fondo ámbar */
}

.process-btn-single:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    font-weight: 400;
}

.process-btn-single:disabled:hover {
    transform: none;
}

/* Animación de feedback para el botón */
.btn-feedback-shake {
    animation: feedbackShake 0.6s ease-in-out;
}

@keyframes feedbackShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Responsive */
@media (max-width: 768px) {
    .process-centers-section {
        padding: 1rem;
    }

    .upload-section {
        padding: 1rem;
    }
} 