/**
 * @file sitios-web.css
 * @brief Estilos de la pestaña Páginas web.
 * @details Mantiene la identidad visual de EquIAtext para la entrada de URL, metadatos, resultados y estados de error.
 * @ingroup estilos
 */

/* =========================================================
   Revisión de sitios web
   ========================================================= */

.contenedor-sitios-web {
    margin-top: 24px;
}

.tarjeta-url-sitio-web {
    overflow: hidden;

    border: 1px solid #ddd;
    border-radius: 12px;

    background: #fff;
}

.cabecera-url-sitio-web {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
}

.cabecera-url-sitio-web h2 {
    margin: 0;
    font-size: 18px;
}

.contenido-url-sitio-web {
    padding: 24px;
}

.icono-pagina-extraida svg,
.enlace-sitio-web svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.campo-url-sitio-web {
    position: relative;

    display: flex;
    align-items: center;

    border: 1px solid #cfc6df;
    border-radius: 10px;

    background: #fff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.campo-url-sitio-web:focus-within {
    border-color: #564376;
    box-shadow: 0 0 0 3px rgba(86, 67, 118, 0.12);
}

.prefijo-url-sitio-web {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    color: #7067A5;
}

.prefijo-url-sitio-web svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-url-sitio-web {
    min-width: 0;
    width: 100%;

    padding: 13px 46px 13px 0;

    border: 0;
    outline: 0;

    background: transparent;
    color: #222;

    font-family: 'Inter', sans-serif;
    font-size: 16px;
}

.input-url-sitio-web::placeholder {
    color: #999;
}

.input-url-sitio-web:disabled {
    cursor: wait;
    color: #777;
}

.boton-limpiar-url-sitio-web {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: transparent;
    color: #7067A5;
}

.boton-limpiar-url-sitio-web:hover {
    background: #EEEAF5;
    color: #4A3678;
    opacity: 1;
}

.boton-limpiar-url-sitio-web:focus-visible {
    outline: 2px solid #564376;
    outline-offset: 1px;
}

.boton-limpiar-url-sitio-web:disabled {
    cursor: wait;
    opacity: 0.45;
}

.boton-limpiar-url-sitio-web svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.ayuda-url-sitio-web {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    margin: 12px 0 0;

    color: #777;
    font-size: 13px;
    line-height: 1.5;
}

.ayuda-url-sitio-web svg {
    flex: 0 0 auto;
    margin-top: 1px;

    fill: none;
    stroke: #7067A5;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tarjeta-sitio-web-extraido {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;

    margin-top: 18px;
    padding: 16px;

    border: 1px solid #d8c9ea;
    border-radius: 12px;

    background: #FAF7FF;
}

.icono-pagina-extraida {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #EEEAF5;
    color: #564376;
}

.datos-sitio-web-extraido {
    min-width: 0;
}

.datos-sitio-web-extraido strong {
    display: block;

    overflow: hidden;

    color: #2F2A5A;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.datos-sitio-web-extraido span {
    display: block;

    overflow: hidden;

    margin-top: 4px;

    color: #777;
    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.enlace-sitio-web {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #d8c9ea;
    border-radius: 9px;

    background: #fff;
    color: #564376;

    text-decoration: none;
}

.enlace-sitio-web:hover {
    background: #EEEAF5;
    color: #4A3678;
}

.aviso-extraccion-sitio-web {
    margin: 12px 0 0;
    padding: 10px 12px;

    border-left: 4px solid #7067A5;
    border-radius: 6px;

    background: #F7F4FC;
    color: #5f5870;

    font-size: 13px;
    line-height: 1.5;
}

#panel-sitios-web .acciones {
    margin-top: 18px;
}

#panel-sitios-web .resultados-documento {
    margin-top: 24px;
}

#panel-sitios-web .contenido-documento-revisado {
    white-space: normal;
}

#panel-sitios-web .contenido-documento-revisado p {
    margin: 0 0 14px;
}

@media (max-width: 700px) {
    .contenido-url-sitio-web {
        padding: 18px;
    }

    .icono-sitio-web {
        margin: 0 auto;
    }

    .tarjeta-sitio-web-extraido {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .enlace-sitio-web {
        grid-column: 1 / -1;
        width: 100%;
    }
}


/* Aviso contextual al escribir una URL incompleta. */
.ayuda-validacion-url {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 9px 0 0 49px;
    padding: 8px 11px;
    border: 1px solid #d8c9ea;
    border-radius: 8px;
    background: #f7f2fb;
    color: #4a3678;
    box-shadow: 0 6px 16px rgba(47, 42, 90, 0.11);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}

.ayuda-validacion-url::before {
    content: "";
    position: absolute;
    left: 18px;
    top: -6px;
    width: 10px;
    height: 10px;
    border-left: 1px solid #d8c9ea;
    border-top: 1px solid #d8c9ea;
    background: #f7f2fb;
    transform: rotate(45deg);
}

.campo-url-sitio-web:has(.input-url-sitio-web[aria-invalid="true"]) {
    border-color: #a65b82;
    box-shadow: 0 0 0 3px rgba(166, 91, 130, 0.11);
}

@media (max-width: 600px) {
    .ayuda-validacion-url {
        margin-left: 0;
    }
}
