/* ============================================
   pulido.css - Estilos Premium para Módulo Dual
   ============================================ */

.mode-selector-container {
    background: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    z-index: 10;
    position: sticky;
    top: 0;
}

.custom-switch-lg .form-check-input {
    width: 3.5rem !important;
    height: 1.75rem !important;
    cursor: pointer;
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.custom-switch-lg .form-check-input:checked {
    background-color: #3b82f6;
    border-color: #2563eb;
}

/* Botones de acción del header (Supervisión / Programación): pills con
   gradiente propio para que salten a la vista, en vez de la pill outline
   discreta que tenían antes -- plan 2026-09-02. */
.btn-pulido-header-action {
    color: #fff !important;
    border: none;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 10px -2px rgb(0 0 0 / 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-pulido-header-action:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -2px rgb(0 0 0 / 0.3);
}

/* Selector de 3 modos (Satélite / Planta PRO / Programado), reemplaza el
   switch binario -- segmented control tipo "pill group". */
.btn-modo-pulido {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 0.55rem 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.btn-modo-pulido:hover {
    border-color: #94a3b8;
    color: #334155;
}

.btn-modo-pulido.activo {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px -2px rgb(0 0 0 / 0.25);
}

#btn-modo-satelite.activo {
    background: linear-gradient(135deg, #0ea5e9, #0369a1);
}

#btn-modo-pro.activo {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

#btn-modo-programado.activo {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

/* Tarjetas de "Modo Programado" */
.tarjeta-programada {
    background: #fff;
    border-radius: 14px;
    border: none;
    border-left: 5px solid #8b5cf6;
    box-shadow: 0 2px 8px -2px rgb(0 0 0 / 0.12);
    padding: 1rem 1.25rem;
}

.tarjeta-programada.fuera-de-orden {
    border-left-color: #f59e0b;
}

/* Styled Form Context */
#panel-pulido-manual .styled-form {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Pro Mode Styling */
.pro-container {
    max-width: 600px;
    margin: 0 auto;
}

#pulido-main-timer {
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    color: #1e293b;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Autocomplete suggestions adjustment */
.autocomplete-suggestions {
    position: absolute;
    background: white;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    border: 1px solid #e2e8f0;
}

.autocomplete-suggestions.active {
    display: block;
}

.suggestion-item:hover {
    background-color: #f8fafc;
    color: #2563eb;
}

/* Quality & Results Premium Styling */
.quality-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
    transition: all 0.3s ease;
}

.quality-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.quality-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-highlight {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #22c55e;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.1);
}

.result-value {
    font-size: 4rem;
    font-weight: 900;
    color: #15803d;
    line-height: 1;
    margin: 0.5rem 0;
}

.result-label {
    color: #166534;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Input refinements */
.input-premium {
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}

.input-premium:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Animación de latido para grabación de voz */
@keyframes pulse-rojo {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.grabando-activo {
    animation: pulse-rojo 1.5s infinite !important;
    background-color: #c82333 !important; /* Rojo oscuro para resaltar estado activo */
}

/* =========================================
   ESTRUCTURA DEL MODAL MASIVO POR VOZ
   ========================================= */

.modal-voz-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.7) !important;
    backdrop-filter: blur(8px);
    display: flex; /* Se inyectará desde JS al abrir, pero por default flex para centrar */
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
}

#caja-modal-voz {
    position: relative !important;
    width: 95% !important; /* Para que deje un margen en la tablet */
    max-width: 900px !important; /* No crecerá más de esto en PC */
    max-height: 90vh !important; /* Nunca se cortará por abajo */
    background: #ffffff;
    border-radius: 16px;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden !important; /* Oculta bordes feos */
    margin: 0 !important; /* Limpia cualquier margin auto */
}

.modal-voz-body {
    overflow-y: auto !important;
    padding: 1.5rem !important;
    flex-grow: 1; /* Toma el espacio disponible */
}

/* =========================================
   CONTRASTE DEL BOTÓN DE DICTADO INTERNO
   ========================================= */

#btn-iniciar-voz-masiva {
    background-color: #dc3545 !important; /* Rojo vibrante */
    color: #ffffff !important; /* TEXTO BLANCO OBLIGATORIO */
    font-weight: bold !important;
    border: none !important;
    text-shadow: none !important; /* Quita sombras extrañas */
    opacity: 1 !important;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.3) !important;
}

/* Forzar que los elementos hijos (iconos y spans) hereden el blanco puro */
#btn-iniciar-voz-masiva *,
#btn-iniciar-voz-masiva i,
#btn-iniciar-voz-masiva span {
    color: #ffffff !important;
}

/* Asegurar que el estado hover mantenga el alto contraste blanco */
#btn-iniciar-voz-masiva:hover,
#btn-iniciar-voz-masiva:focus,
#btn-iniciar-voz-masiva:active {
    background-color: #c82333 !important; /* Rojo ligeramente más oscuro */
    color: #ffffff !important;
    box-shadow: 0 6px 8px rgba(220, 53, 69, 0.4) !important;
}

/* =========================================
   COMPATIBILIDAD MÓVIL PARA INPUTS DE TIEMPO
   ========================================= */
input[type="time"] {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px; /* Evita auto-zoom en iOS */
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-appearance: none; /* Fuerza la UI nativa en Safari/Chrome mobile */
    background-color: #fff;
    min-height: 45px; /* Asegura un área táctil lo suficientemente grande (Touch Target) */
}
