/* =============================================================================
   estilos.css — Proyecto de Análisis de Biodiversidad Marina Coral
   IES Sierra de Guara — Enjambre Aka / Homero
   Diseño: Responsive, tema marino oscuro, sin dependencias externas.
   ============================================================================= */

/* ─── VARIABLES DE TEMA ─────────────────────────────────────────────────────── */
:root {
    --azul-abismo:  #05141f;
    --azul-deep:    #0a2233;
    --azul-medio:   #0e344d;
    --cian-coral:   #26c6da;
    --turquesa:     #4dd0e1;
    --coral:        #ff6b6b;
    --coral-suave:  #ff9e80;
    --arena:        #eef4f7;
    --gris-suave:   #a9c2cf;
    --texto:        #e6f1f5;
    --texto-dim:    #9fb8c5;
    --borde:        rgba(77, 208, 225, 0.18);
    --gradiente-hero: linear-gradient(160deg, #061a28 0%, #0a2b40 55%, #0d3a52 100%);
    --sombra:       0 8px 30px rgba(0, 0, 0, 0.45);
    --radio:        14px;
    --fuente:       "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono:         "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ─── RESET Y BASE ──────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente);
    background: var(--azul-abismo);
    color: var(--texto);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(38, 198, 218, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 10%, rgba(255, 107, 107, 0.05) 0%, transparent 40%);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--turquesa);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--cian-coral);
}

/* ─── NAVEGACIÓN ────────────────────────────────────────────────────────────── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 22, 34, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--borde);
}

.nav-contenedor {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-marca {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--texto);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-marca .logo {
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    gap: 0.35rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    color: var(--texto-dim);
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.activo {
    color: var(--cian-coral);
    background: rgba(38, 198, 218, 0.08);
    border-color: var(--borde);
}

/* ─── HERO (INDEX) ──────────────────────────────────────────────────────────── */
.hero {
    background: var(--gradiente-hero);
    padding: 4.5rem 1.5rem 3.5rem;
    text-align: center;
    border-bottom: 1px solid var(--borde);
}

.hero-contenedor {
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: rgba(38, 198, 218, 0.12);
    border: 1px solid var(--borde);
    color: var(--turquesa);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, #eef4f7 0%, var(--turquesa) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p.lead {
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    color: var(--texto-dim);
    max-width: 720px;
    margin: 0 auto 1.8rem;
}

.hero-cta {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primario {
    background: var(--cian-coral);
    color: #04141f;
}

.btn-primario:hover {
    color: #04141f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(38, 198, 218, 0.35);
}

.btn-secundario {
    border: 1px solid var(--borde);
    color: var(--texto);
    background: rgba(255, 255, 255, 0.03);
}

.btn-secundario:hover {
    border-color: var(--turquesa);
    color: var(--turquesa);
}

/* ─── CONTENIDO GENERAL ─────────────────────────────────────────────────────── */
.contenedor {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    width: 100%;
}

.seccion {
    margin-bottom: 3rem;
}

.seccion h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.seccion h2 .icono {
    color: var(--cian-coral);
}

.seccion h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--turquesa);
    margin: 1.5rem 0 0.6rem;
}

.seccion p {
    color: var(--texto-dim);
    margin-bottom: 1rem;
    max-width: 85ch;
}

.subrayado {
    width: 60px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--cian-coral), var(--coral));
    margin-bottom: 1.5rem;
}

/* ─── TARJETAS ──────────────────────────────────────────────────────────────── */
.grid-tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.tarjeta {
    background: var(--azul-deep);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tarjeta:hover {
    transform: translateY(-4px);
    border-color: rgba(38, 198, 218, 0.45);
}

.tarjeta .tarjeta-icono {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.tarjeta h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: var(--texto);
}

.tarjeta p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--texto-dim);
}

/* ─── ESPECIES / CLUSTERS ───────────────────────────────────────────────────── */
.grid-clusters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.cluster {
    border-radius: var(--radio);
    border: 1px solid var(--borde);
    padding: 1.5rem;
    background: var(--azul-deep);
}

.cluster-lepto {
    border-top: 4px solid var(--cian-coral);
}

.cluster-euni {
    border-top: 4px solid var(--coral);
}

.cluster h3 {
    margin: 0 0 0.8rem;
    font-size: 1.1rem;
}

.chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.6rem 0 0.8rem;
}

.chip {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(38, 198, 218, 0.1);
    border: 1px solid var(--borde);
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--turquesa);
}

.chip-rojo {
    background: rgba(255, 107, 107, 0.1);
    color: var(--coral-suave);
}

/* ─── TABLAS ────────────────────────────────────────────────────────────────── */
.tabla-contenedor {
    overflow-x: auto;
    border-radius: var(--radio);
    border: 1px solid var(--borde);
    background: var(--azul-deep);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    font-size: 0.92rem;
}

thead th {
    background: rgba(38, 198, 218, 0.1);
    color: var(--turquesa);
    text-align: left;
    padding: 0.85rem 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

tbody td {
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--borde);
    color: var(--texto-dim);
    vertical-align: top;
}

tbody tr:hover td {
    background: rgba(38, 198, 218, 0.04);
}

td.mono, td.num {
    font-family: var(--mono);
    color: var(--texto);
}

td .tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.tag-lepto {
    background: rgba(38, 198, 218, 0.15);
    color: var(--turquesa);
}

.tag-euni {
    background: rgba(255, 107, 107, 0.15);
    color: var(--coral-suave);
}

.tag-alerta {
    background: rgba(255, 193, 7, 0.15);
    color: #ffd54f;
}

/* ─── BARRAS DE PROGRESO (METRICAS) ─────────────────────────────────────────── */
.metrica {
    margin-bottom: 1rem;
}

.metrica-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.metrica-header .nombre {
    color: var(--texto);
    font-weight: 500;
}

.metrica-header .valor {
    font-family: var(--mono);
    color: var(--turquesa);
}

.barra {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.barra > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cian-coral), var(--turquesa));
    width: 0;
    transition: width 1s ease;
}

.barra-roja > span {
    background: linear-gradient(90deg, var(--coral), var(--coral-suave));
}

/* ─── PASOS DEL PIPELINE ────────────────────────────────────────────────────── */
.lista-pasos {
    list-style: none;
    counter-reset: paso;
    margin-top: 1.2rem;
}

.lista-pasos li {
    position: relative;
    padding: 1.2rem 1.2rem 1.2rem 4rem;
    background: var(--azul-deep);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    margin-bottom: 0.9rem;
    counter-increment: paso;
}

.lista-pasos li::before {
    content: counter(paso);
    position: absolute;
    left: 1.2rem;
    top: 1.2rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(38, 198, 218, 0.15);
    border: 1px solid var(--borde);
    color: var(--turquesa);
    font-family: var(--mono);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lista-pasos li h3 {
    margin: 0 0 0.35rem;
}

.lista-pasos li p {
    margin: 0;
    font-size: 0.92rem;
}

.cmd {
    display: inline-block;
    background: #041018;
    border: 1px solid var(--borde);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--turquesa);
}

/* ─── DIAGRAMA DE FLUJO ─────────────────────────────────────────────────────── */
.flujo {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.flujo-nodo {
    background: var(--azul-deep);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 0.9rem 1.6rem;
    text-align: center;
    min-width: 220px;
    max-width: 320px;
}

.flujo-nodo .titulo {
    font-weight: 700;
    color: var(--texto);
    font-size: 0.98rem;
}

.flujo-nodo .sub {
    font-size: 0.8rem;
    color: var(--texto-dim);
    font-family: var(--mono);
}

.flujo-nodo.destacado {
    border-color: rgba(38, 198, 218, 0.5);
    background: rgba(38, 198, 218, 0.07);
}

.flujo-flecha {
    color: var(--cian-coral);
    font-size: 1.5rem;
    padding: 0.2rem 0;
    line-height: 1;
}

.flujo-bifurcacion {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.flujo-bifurcacion .flujo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── INFRAESTRUCTURA ───────────────────────────────────────────────────────── */
.grid-infra {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.infra-item {
    background: var(--azul-deep);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.3rem;
}

.infra-item .etiqueta {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--cian-coral);
    margin-bottom: 0.5rem;
}

.infra-item h4 {
    color: var(--texto);
    margin-bottom: 0.4rem;
}

.infra-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* ─── FOOTER ────────────────────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--borde);
    background: var(--azul-deep);
    padding: 1.5rem 1.5rem 2rem;
    margin-top: auto;
}

.footer-contenido {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--texto-dim);
}

/* ─── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .nav-contenedor {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .hero {
        padding: 3rem 1.2rem 2.5rem;
    }

    .flujo-bifurcacion {
        gap: 1.2rem;
    }
}

/* ─── UTILIDADES ────────────────────────────────────────────────────────────── */
.texto-centro {
    text-align: center;
}

.nota {
    font-size: 0.85rem;
    color: var(--texto-dim);
    border-left: 3px solid var(--cian-coral);
    padding: 0.6rem 1rem;
    background: rgba(38, 198, 218, 0.05);
    border-radius: 0 var(--radio) var(--radio) 0;
    margin: 1rem 0;
}


