/* Importación de la fuente Poppins desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');

/* Reglas generales y de reseteo */
:root {
    --primary-color: #1597a0;
    --secondary-color: #6c757d;
    --success-color: #1597a0;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #343a40;
    --white: #fff;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-gray);
    margin: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--dark-gray);
}

.rating-group img {
    width: 100px;
    height: 100px;
}

/* Tipografía */
.poppins-regular {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

.poppins-medium {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.roboto-bold {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
}

.header {
    width: 100%;
    max-width: 800px;
    text-align: center;
    padding-bottom: 1rem;
}

.logo {
    height: 50px;
}

.animate__fadeIn {
    animation: bounce; /* referring directly to the animation's @keyframe declaration */
    animation-duration: 2s; /* don't forget to set a duration! */
}

.main-content {
    width: 100%;
    max-width: 800px;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.title {
    text-align: center;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.subtitle {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* Estilos del formulario */
#satisfaction-survey-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.instructions {
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-input,
.form-select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* Botones */
.search-btn,
.button-yes,
.button-no,
.submit-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

header img {
    width: 35%;
    height: 40px;
}

.search-btn {
    background-color: var(--primary-color);
    color: var(--white);
}

.document-search-container {
    display: grid;
    grid-template-columns: 6fr 1fr;
    width: 100%;
    align-items: center;
    gap: 1rem;
}

.document-search .form-input {
    width: 100%;
}

/* El botón de búsqueda será más compacto */
.document-search-container .search-btn {
    padding: 0.5rem; /* Ajusta el padding para reducir el tamaño del botón */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Elimina el padding excesivo para que el tamaño dependa más del SVG */
}

/* Ajusta el tamaño del ícono dentro del botón */
.document-search-container .search-btn svg {
    width: 24px; /* O el tamaño que prefieras */
    height: 24px; /* O el tamaño que prefieras */
}

.button-yes {
    background-color: var(--primary-color); /* Un verde claro para el fondo */
    color: white; /* Un verde oscuro para el texto */
}

.button-no {
    background-color: var(--danger-color); /* Un rojo claro para el fondo */
    color: white; /* Un rojo oscuro para el texto */
}

.selected-border {
    border: 4px solid black;
}

.submit-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 1.2rem;
    padding: 1rem;
    margin-top: 1rem;
}

.submit-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Grupos de opciones (checkbox y radio) */
.checkbox-group,
.rating-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.animate__fadeInUp {
    animation: bounce; /* referring directly to the animation's @keyframe declaration */
    animation-duration: 1s; /* don't forget to set a duration! */
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    height: 1.25rem;
    width: 1.25rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.other-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.other-option input[type="text"] {
    flex-grow: 1;
}

/* DISEÑO PARA LA PREGUNTA 1 */
/* Estilos específicos de la calificación (NPS) */
.rating-group {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    gap: 0rem;
    flex-wrap: wrap;
}

.rating-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rating-label {
    padding: 0.5rem;
    margin-left: 0.19rem;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

/* Estilo para las imágenes dentro del label */
.rating-label img {
    width: 60px; /* O el tamaño que desees */
    height: 60px;
    /* Opcional: para que se vean más nítidas si son de alta resolución */
    object-fit: contain;
}

.rating-label:hover {
    transform: scale(1.1);
}

/* Estilo para la carita seleccionada (APLICADO A TODAS) */
.rating-option input[type="radio"]:checked + .rating-label {
    transform: scale(1.2); /* Un poco más de escala para que se note la selección */
    /* Opcional: puedes agregar una sombra o un borde para que resalte más */
    /* box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); */
}

/* ------------------------------------------- */
/* Nuevas reglas: Colores de fondo por carita */
/* ------------------------------------------- */

/* Carita 1: Muy insatisfecho (Rojo) */
#rating-medico-1:checked + .rating-label,
#rating-1:checked + .rating-label {
    background-color: #fca5a5; /* Un tono de rojo pastel */
}

/* Carita 2: Insatisfecho (Naranja) */
#rating-medico-2:checked + .rating-label,
#rating-2:checked + .rating-label {
    background-color: #fcd34d; /* Un tono de amarillo-naranja */
}

/* Carita 3: Neutral (Amarillo) */
#rating-medico-3:checked + .rating-label,
#rating-3:checked + .rating-label {
    background-color: #fde047; /* Un tono de amarillo */
}

/* Carita 4: Satisfecho (Verde claro) */
#rating-medico-4:checked + .rating-label,
#rating-4:checked + .rating-label {
    background-color: #d9f991; /* Un tono de verde lima */
}

/* Carita 5: Muy feliz (Verde fuerte) */
#rating-medico-5:checked + .rating-label,
#rating-5:checked + .rating-label {
    background-color: #86efac; /* Un tono de verde claro */
}

/*Fin de caritas - 1 */

/*DISEÑO PARA LA PREGUNTA - 2*/
/* Emoji 1: 😡 (Rojo) */
#rating-medico-1:checked + .rating-label {
    transform: scale(1.1);
}

/* Emoji 2: 😠 (Naranja) */
#rating-medico-2:checked + .rating-label {
    transform: scale(1.1);
}

/* Emoji 3: 😐 (Amarillo) */
#rating-medico-3:checked + .rating-label {
    transform: scale(1.1);
}

/* Emoji 4: 🙂 (Verde Claro) */
#rating-medico-4:checked + .rating-label {
    transform: scale(1.1);
}

/* Emoji 5: 😀 (Verde Fuerte) */
#rating-medico-5:checked + .rating-label {
    transform: scale(1.1);
}

.rating-group .rating-option .face_medico {
    width: 60px;
    height: 60px;
}

/*FIN CARITAS - 2 */
/* Botones Sí/No */
.yes-no-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem; /* Aumenta el espacio entre los botones */
    margin-top: 1rem;
}

.button-yes,
.button-no {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease; /* Transición suave para todos los cambios */
    width: 150px; /* Ancho fijo para que los botones tengan el mismo tamaño */
}

/* Responsividad para pantallas pequeñas */
@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .title {
        font-size: 1.5rem;
    }

    .form-group,
    .rating-group {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-btn {
        padding: 0.75rem 1rem;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        display: flex; /* Alinea el SVG dentro del botón */
        align-items: center;
        justify-content: center;
        transition: background-color 0.3s ease, transform 0.2s ease;
    }

    .search-btn svg {
        color: #fff; /* Color blanco para el ícono */
        height: 1.25rem;
        width: 1.25rem;
    }

    /* Efecto al pasar el cursor sobre el botón */
    .search-btn:hover {
        background-color: #0056b3; /* Un azul más oscuro */
        transform: translateY(-1px); /* Ligero efecto de elevación */
    }

    /* Efecto al hacer clic en el botón */
    .search-btn:active {
        transform: translateY(0);
    }

    /* Este es el contenedor que alinea el spinner y el texto */
    .loader-container {
        display: flex;
        align-items: center; /* Alinea verticalmente */
        justify-content: center; /* Alinea horizontalmente */
        gap: 10px; /* Espacio entre el spinner y el texto */
        min-height: 100px; /* Le da una altura para que el spinner sea visible */
    }

    .loader-container {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-height: 100px;
    }

    .nom_doc {
        color: #dc3545;
    }

    #resultado {
        text-align: center;
    }

    /* Contenedor del resultado de búsqueda */
    .search-result {
        text-align: center;
        margin-top: 2rem;
    }

    /* Contenedor individual de cada médico */
    .doctor-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1.5rem;
        border: 1px solid var(--medium-gray);
        border-radius: 12px;
        background-color: var(--white);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
        transition: transform 0.3s ease;
        margin-bottom: 1rem;
    }

    .doctor-card:hover {
        transform: translateY(-5px);
    }

    /* Imagen del médico */
    .doctor-image {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--primary-color);
        margin-bottom: 1rem;
    }

    /* Nombre del doctor */
    .doctor-name {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--dark-gray);
        margin: 0.5rem 0;
    }

    /* Especialidad del doctor */
    .doctor-specialty {
        font-size: 1rem;
        color: var(--secondary-color);
        margin: 0;
    }

    /* Estilo para el mensaje de carga */
    .loader-message {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        font-size: 1.2rem;
        color: var(--primary-color);
        min-height: 100px;
    }


    .doctor-image {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
    }

    .doctor-name {
        font-size: 1.2rem;
        font-weight: bold;
        color: #333;
        margin: 0;
    }

    .doctor-specialty {
        font-size: 1rem;
        color: #666;
        margin: 0;
    }

    .red {
        color: #dc3545;
    }

    .imagenModalInsalud {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }

    .imagenModalInsalud_img {
        max-width: 90%;
        max-height: 90vh;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .hidden {
        display: none;
    }
}