﻿/* Transición para cerrar suavemente 
#loading {
    transition: opacity 0.3s ease-in-out;
}

    #loading.hidden {
        opacity: 0;
    }

 Fondo de carga 
.loading-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
*/
/* ======================================
   1. Pantalla completa con degradado animado
   ====================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Fondo con gradiente animado */
    background: linear-gradient(-45deg, #3f99c8, #00d4ff, #3f99c8, #00d4ff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* Para la animación de salida (slide + fade) */
    transition: /*transform 0.6s ease, */opacity 0.6s ease;
/*    transform: translateY(0);
*/    opacity: 1;
}

    /* Cuando agregues la clase .slide-out, desaparece y sube */
    .loading-screen.slide-out {
/*        transform: translateY(-100%);
*/        opacity: 0;
    }

/* ======================================
   2. Definición de keyframes para el degradado
   ====================================== */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ======================================
   3. Contenido centralizado
   ====================================== */
.loading-content {
    text-align: center;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ======================================
   4. Logo con animación “fadeIn” y “pulse”
   ====================================== */
.loading-logo {
    width: 120px; /* O max-width: 180px si prefieres */
    margin-bottom: 30px;
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    animation: fadeIn 1s ease forwards, pulse 2.5s ease-in-out 1s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}

/* ======================================
   5. Contenedor y animación del ECG
   ====================================== */
.ecg-container {
    width: 80%;
    max-width: 700px;
    height: 100px;
    overflow: hidden;
    position: relative;
    margin: 0 auto 20px;
}

/* SVG ECG desplazándose con fade-in / fade-out */
#ecg-anim {
    width: 250%; /* Doble ancho para desplazamiento continuo */
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: ecg-scroll 7s linear infinite;
    opacity: 0; /* Comienza transparente */
    animation-fill-mode: forwards;
}

.ecg-line {
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    /* Efecto de brillo */
    filter: drop-shadow(0 0 6px #00e5ff);
}

@keyframes ecg-scroll {
    0% {
        transform: translateX(0);
        opacity: 0;
    }

    5% {
        opacity: 1; /* Aparece con un efecto de desvanecimiento */
    }

    95% {
        transform: translateX(-50%);
        opacity: 0; /* Desvanece al final */
    }

    100% {
        opacity: 0;
    }
}

/* ======================================
   6. Spinner circular secundario (CSS puro)
   ====================================== */
/*.spinner {
    margin: 0 auto 20px;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}*/

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ======================================
   7. Texto de carga con pulso (pulseText)
   ====================================== */
.loading-text {
    font-size: 20px;
    margin-top: 15px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ======================================
   8. Responsividad para dispositivos móviles
   ====================================== */
@media (max-width: 600px) {
    .loading-logo {
        width: 100px;
        margin-bottom: 20px;
    }

    .loading-text {
        font-size: 18px;
    }

    .ecg-container {
        height: 80px;
    }

    .spinner {
        width: 32px;
        height: 32px;
        margin-bottom: 16px;
    }
}









/* Transición para cerrar suavemente */
/*#loading-screen {
    transition: opacity 0.4s ease-in-out;
    position: fixed;*/ /* Cambiado a fixed para cubrir toda la pantalla */
    /*top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    #loading-screen.hidden {
        opacity: 0;
        display: none;*/ /* Oculta completamente el elemento */
    /*}

.loading-content {
    text-align: center;
}

.loading-logo {
    max-width: 200px;*/ /* Ajusta el tamaño del logo */
    /*margin-bottom: 20px;
}

.ecg-container {
    margin-bottom: 20px;
}

.ecg-line {
    fill: none;
    stroke: #007bff;*/ /* Color de la línea del ECG */
    /*stroke-width: 2;
    animation: ecg-animation 10s linear infinite;
}

@keyframes ecg-animation {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-1020px);
    }
}

.loading-text {
    font-size: 1.2em;
}*/



/* -------------------------------------------------
   0. Asegúrate de que html y body ocupen 100% alto 
   ------------------------------------------------- */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* -------------------------------------------------
   1. Centrar <main class="wrapper vh-100"> vertical 
      y horizontalmente
   ------------------------------------------------- */
main.wrapper.vh-100 {
    /* Usa toda la altura de viewport */
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrado vertical */
    align-items: center; /* Centrado horizontal */
    background: #f8f9fa; /* Si quieres un fondo gris claro */
}

/* -------------------------------------------------
   2. El <section class="container"> no debe añadir 
      márgenes que lo desplace hacia arriba
   ------------------------------------------------- */
section.container {
    margin: 0; /* Quita márgenes por defecto */
    padding: 0; /* Quita padding si sobra */
    width: 100%;
}

/* -------------------------------------------------
   3. Contenedor flex dentro de cada slide 
      (ocupar 100% ancho y centrar cards) 
   ------------------------------------------------- */
.carousel-item .d-flex {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centra horizontal */
    gap: 20px; /* Espacio entre tarjetas */
    padding: 0 20px; /* Padding para que no queden pegadas a los lados */
}

/* -------------------------------------------------
   4. .clinic-card (label) – ocupa su contenido 
      habitual, sin empujar nada al top
   ------------------------------------------------- */
.clinic-card {
    cursor: pointer;
    position: relative;
    flex: 1 1 280px;
    max-width: 350px;
    background-color: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px; /* Separación vertical entre slides en caso de stacking */
}

    .clinic-card:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    }

/* -------------------------------------------------
   5. Ocultar el <input type="radio">
   ------------------------------------------------- */
.radio-full-card {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* -------------------------------------------------
   6. Resaltar cuando esté seleccionado 
      (compatibles con navegador que soporte :has)
   ------------------------------------------------- */
.clinic-card:has(.radio-full-card:checked) {
    border: 2px solid #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.25);
}

/* -------------------------------------------------
   7. Imagen superior dentro de .clinic-card 
   ------------------------------------------------- */
.clinic-card .card-img-top {
    height: 180px;
    object-fit: contain;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* -------------------------------------------------
   8. Cuerpo de la tarjeta (texto centrado) 
   ------------------------------------------------- */
.clinic-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 16px;
}

.clinic-card .card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    text-align: center;
}

.clinic-card .card-text {
    font-size: 0.95rem;
    color: #555;
    text-align: center;
    margin-bottom: 12px;
}

.clinic-card .text-warning {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* -------------------------------------------------
   9. Controles del carousel (separados de las cards)
   ------------------------------------------------- */
.carousel-control-prev {
    left: -30px; /* Mover un poco hacia afuera */
}

.carousel-control-next {
    right: -30px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
}

.carousel-control-prev-icon {
    background-image: url('/Image/prev.png');
}

.carousel-control-next-icon {
    background-image: url('/Image/next.png');
}

/* -------------------------------------------------
   10. Botón “Confirmar Selección” centrado más estrecho
   ------------------------------------------------- */
.form-group.text-center button.btn-primary {
    display: inline-block;
    width: auto;
    min-width: 180px;
    padding: 10px 24px;
    font-size: 1rem;
}

/* -------------------------------------------------
   11. Responsividad para pantallas pequeñas
   ------------------------------------------------- */
@media (max-width: 768px) {
    .clinic-card {
        flex: 1 1 45%;
        max-width: 45%;
    }

        .clinic-card .card-img-top {
            height: 160px;
        }
}

@media (max-width: 576px) {
    .clinic-card {
        flex: 1 1 100%;
        max-width: 100%;
    }

        .clinic-card .card-img-top {
            height: 140px;
        }
}
