/* =============================================
   VERIFICACION - Estilos Específicos
   Vistas de CSI/TurnosBundle/Resources/views/Verificacion
   Complementa a tramite-previsional.css
   ============================================= */

/* ===================
   1. SELECCIONAR TRÁMITE (Grid, Toolbar & Tarjetas)
   =================== */
body {
    background-color: #f4f7f9 !important;
}

.titulo-pantalla {
    color: #0c6ddf;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
}

/* Toolbar Sticky & Filtros */
.filtros-toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    position: sticky;
    top: 10px;
    z-index: 100;
}

.toolbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.pills-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill-btn {
    background: #f0f4f8;
    border: 1px solid #cfd8dc;
    color: #546e7a;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pill-btn:hover { background: #e1e8ed; }
.pill-btn.active {
    background: #0c6ddf;
    color: white;
    border-color: #0c6ddf;
    box-shadow: 0 2px 8px rgba(12, 109, 223, 0.25);
}

.btn-limpiar {
    background: transparent;
    border: none;
    color: #e53935;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}
.btn-limpiar:hover { background: #ffebee; }

.toolbar-inputs {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    align-items: center;
}

.search-box { position: relative; }
.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9e9e9e;
}
.search-box input {
    padding-left: 40px !important;
    margin-bottom: 0 !important;
    border: 1px solid #cfd8dc !important;
    border-radius: 6px !important;
    height: 40px !important;
    background: white !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    font-size: 0.95rem !important;
}
.search-box input:focus {
    border-color: #0c6ddf !important;
    box-shadow: 0 0 0 1px #0c6ddf !important;
}

select.browser-default.modern-select {
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    height: 40px;
    background-color: white;
    color: #444;
    padding: 0 10px;
    width: 100%;
    font-size: 0.9rem;
    outline: none;
}

/* Grilla CSS */
.grid-tramites {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    align-items: stretch;
}

/* Tarjetas de Trámite */
.card-moderna {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    user-select: none;
}
.card-moderna:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.card-moderna.presencial { border-left: 5px solid #00897b; }
.card-moderna.presencial:hover { border-color: #00897b; }
.card-moderna.virtual { border-left: 5px solid #00acc1; }
.card-moderna.virtual:hover { border-color: #00acc1; }

.card-mod-header {
    padding: 15px 20px 5px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-mod {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
}
.badge-mod i { font-size: 1rem; }
.badge-mod.presencial { background: #e0f2f1; color: #00695c; }
.badge-mod.virtual { background: #e0f7fa; color: #00838f; }

.card-mod-body {
    padding: 10px 20px 20px 20px;
    flex-grow: 1;
}

.tramite-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: #263238;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.tramite-cat {
    font-size: 0.8rem;
    color: #78909c;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}
.tramite-cat i { font-size: 0.95rem; color: #b0bec5; margin-top: 1px;}

.card-mod-footer {
    border-top: 1px solid #f0f0f0;
    padding: 10px 20px;
    background: #fafafa;
    margin-top: auto;
}
.btn-info-tramite {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0c6ddf;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: none;
}
.btn-info-tramite:hover { color: #0d47a1; text-decoration: underline; }

.card-moderna.selected {
    border: 2px solid #4caf50;
    border-left-width: 5px;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    pointer-events: none;
}

.overlay-seleccion {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.92);
    z-index: 10;
    display: none; 
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #4caf50;
    font-weight: bold;
    font-size: 1.1rem;
    animation: fadeInAnim .2s;
}

.spin-icon {
    animation: spin 1s infinite linear;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

.alerta-vacio {
    text-align: center;
    padding: 40px 20px;
    color: #90a4ae;
    font-size: 1.2rem;
    grid-column: 1 / -1;
}
.alerta-vacio i { font-size: 4rem; margin-bottom: 15px; color: #cfd8dc; }

/* ===================
   2. TARJETA MODERNA (solicitante & tramite)
   =================== */
.tarjeta-moderna {
    background-color: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    padding: 25px !important;
    margin-bottom: 30px !important;
}

.tarjeta-moderna-header {
    border-bottom: 2px solid #00acc1 !important;
    padding-bottom: 10px !important;
    margin-bottom: 20px !important;
}

.tarjeta-moderna-header h4 {
    margin: 0 !important;
    font-size: 1.4rem !important;
    font-weight: bold !important;
    color: #00acc1 !important;
}

.info-item {
    font-size: 1.1rem !important;
    color: #424242 !important;
    margin-bottom: 15px !important;
    display: flex !important;
    align-items: center !important;
}

.info-item i {
    color: #00acc1 !important;
    margin-right: 10px !important;
}

.textoDestacado.alerta-error {
    border-left-color: #f44336 !important;
    background-color: #ffebee !important;
}

/* ===================
   3. DATOS SOLICITANTE - VALIDACIONES & LOADING OVERLAY
   =================== */
.campo-error input,
.campo-error select,
.campo-error textarea {
    border-bottom: 2px solid #e53935 !important;
    box-shadow: 0 1px 0 0 #e53935 !important;
}
.campo-error label,
.campo-error .label-compuesto {
    color: #e53935 !important;
}
.campo-error select.browser-default {
    border: 1px solid #e53935 !important;
}

.msg-error-campo {
    color: #e53935;
    font-size: 0.78rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.msg-error-campo i { font-size: 1rem; }

@keyframes shakeField {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.campo-shake { animation: shakeField 0.4s ease-in-out; }

.toast-errores {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #e53935;
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.35);
    z-index: 9999;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.toast-errores.visible { opacity: 1; }

.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.loading-overlay.active {
    display: flex !important;
    opacity: 1;
}
.loading-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 3rem 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 450px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.loading-overlay.active .loading-card { transform: scale(1); }

.spinner-loader {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(0, 188, 212, 0.15);
    border-top-color: #00bcd4;
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 1.5rem auto;
}
.loading-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}
.loading-subtitle {
    font-size: 0.95rem;
    color: #475569;
    margin: 0;
}

/* ===================
   4. OFERTAS DE TURNO
   =================== */
.tituloTramite {
    text-align: left;
    text-justify: inter-word;
    text-indent: 1px;
}
.oculto { display: none; }

.info-comun-card {
    width: 95%; 
    max-width: 900px; 
    margin: 0 auto 30px auto; 
    background-color: white;
    padding: 25px; 
    border: solid 1px #e0e0e0; 
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* =============================================
   TEMPORIZADOR DE RESERVA PROVISIONAL
   ============================================= */
.timer-reserva-container {
    max-width: 800px;
    margin: 0 auto 25px auto;
}

.timer-card {
    background: #ffffff;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 15px rgba(12, 109, 223, 0.08);
    transition: all 0.3s ease;
}

.timer-reserva-container.timer-aviso .timer-card {
    border-color: #ffe082;
    background: #fffdf7;
    box-shadow: 0 4px 15px rgba(251, 140, 0, 0.12);
}

.timer-reserva-container.timer-urgente .timer-card {
    border-color: #ffcdd2;
    background: #fff8f8;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.15);
}

.timer-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.timer-icon {
    font-size: 1.8rem;
    color: #0c6ddf;
}
.timer-aviso .timer-icon { color: #fb8c00; }
.timer-urgente .timer-icon { color: #e53935; }

.timer-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #37474f;
}

.timer-digits {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: monospace, sans-serif;
    color: #0c6ddf;
    background: #e3f2fd;
    padding: 3px 12px;
    border-radius: 8px;
    letter-spacing: 1px;
    border: 1px solid #90caf9;
}
.timer-aviso .timer-digits {
    color: #e65100;
    background: #fff3e0;
    border-color: #ffb74d;
}
.timer-urgente .timer-digits {
    color: #b71c1c;
    background: #ffebee;
    border-color: #ef9a9a;
}

.timer-blink {
    animation: blinkEffect 1s infinite alternate;
}

@keyframes blinkEffect {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.7; transform: scale(1.04); }
}

.timer-progress-bg {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.timer-progress-bar {
    height: 100%;
    background-color: #0c6ddf;
    transition: width 1s linear, background-color 0.5s ease;
    border-radius: 4px;
}

.timer-info-text {
    font-size: 0.85rem;
    color: #78909c;
    text-align: center;
    line-height: 1.3;
}

/* Modal Alerta Expirado */
.alerta-expirado-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.alerta-expirado-card {
    background: #ffffff;
    max-width: 520px;
    width: 100%;
    padding: 35px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.alerta-expirado-icon {
    font-size: 3.5rem;
    color: #e53935;
    margin-bottom: 15px;
}
.alerta-expirado-icon i {
    font-size: 3.5rem;
}

.alerta-expirado-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #263238;
}

.alerta-expirado-card p {
    font-size: 0.98rem;
    color: #546e7a;
    line-height: 1.5;
    margin-bottom: 25px;
}

.alerta-expirado-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.alerta-expirado-actions .btn-large {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.contenedor-ofertas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    width: 95%;
    max-width: 1200px;
    margin: 20px auto 40px auto;
}

.tarjeta-opcion {
    background: #fff;
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tarjeta-opcion:hover {
    transform: translateY(-5px);
    border-color: #2196f3;
    box-shadow: 0 8px 20px rgba(33, 150, 243, 0.15);
}

.opcion-header {
    background-color: #f5f5f5;
    color: #555;
    text-align: center;
    padding: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

.opcion-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fecha-hora-bloque {
    text-align: center;
    margin-bottom: 25px;
}

.botones-oferta {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.btn-accion {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 6px;
    padding: 0 20px;
    width: 100%;
}

/* ===================
   5. TICKET Y PANEL FECHA / HORA
   =================== */
.panel-fecha-hora {
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.titulo-panel {
    margin: 0 0 20px 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1.4rem;
    opacity: 0.95;
}

.caja-resaltada {
    background: #ffffff;
    color: #111111;
    padding: 15px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    min-height: 145px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.caja-resaltada i {
    font-size: 2.5rem;
    margin-bottom: 5px;
    color: #0c6ddf; 
}
.caja-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #666666; 
    margin-bottom: 2px;
    font-weight: bold;
}
.caja-valor {
    font-size: 1.6rem;
    font-weight: 900; 
    line-height: 1.2;
    color: #000000; 
}

.contenedor-qr-datos {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 20px;
}
.caja-qr {
    flex: 0 0 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}
.caja-datos {
    flex: 1;
    min-width: 0;
}

/* ===================
   6. SELECT2 MATERIALIZE OVERRIDES
   =================== */
.select2-selection {
    height: 46px !important;
    border-radius: 6px !important;
    border: 1px solid #bcd0e0 !important;
    display: flex !important;
    align-items: center !important;
    background-color: white !important;
}

.select2-selection__rendered {
    font-size: 16px !important;
    margin-left: 10px !important;
    color: #000000 !important;
}

.select2-selection__arrow {
    height: 100% !important;
}

.select2-container--default .select2-results__option {
    color: #000000 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #00acc1 !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #e0f7fa !important;
    color: #000000 !important;
}

/* ===================
   7. RESPONSIVE BREAKPOINTS
   =================== */
@media (max-width: 768px) {
    .toolbar-inputs { grid-template-columns: 1fr; gap: 10px; }
    .toolbar-top { flex-direction: column; align-items: stretch; }
    .btn-limpiar { align-self: flex-end; }
}

@media (max-width: 600px) {
    .caja-qr {
        flex: 0 0 110px; 
        padding: 5px;
    }
}

/* ===================
   8. MODAL DE INFORMACIÓN (RESPONSIVE & CENTERED)
   =================== */
#modalTramite {
    border-radius: 12px !important;
    max-width: 550px !important;
    width: 90% !important;
    max-height: 85vh !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    background-color: #ffffff !important;
    z-index: 1003 !important;
}

#modalTramite .modal-content {
    max-height: calc(85vh - 56px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 24px 20px 15px 20px !important;
}

#modalTramite .modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 8px 16px !important;
    height: auto !important;
    text-align: center;
}

#modalTramite .modal-footer .modal-close {
    font-weight: 700 !important;
    color: #0c6ddf !important;
    font-size: 0.95rem !important;
    width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 600px) {
    #modalTramite {
        width: 92% !important;
        max-width: 92% !important;
        max-height: 82vh !important;
        top: 7% !important;
        left: 4% !important;
        right: 4% !important;
    }

    #modalTramite .modal-content {
        max-height: calc(82vh - 52px) !important;
        padding: 16px 14px 10px 14px !important;
    }

    #modalTramite .modal-header-container {
        gap: 8px !important;
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }

    #modalTramite .modal-header-title {
        font-size: 1.1rem !important;
        line-height: 1.35 !important;
    }

    #modalTramite .modal-body-text {
        font-size: 0.92rem !important;
        line-height: 1.5 !important;
    }
}

