/* =======================
   HOME HERO
======================= */

.hero {
    position: relative;
    min-height: calc(100vh - 80px);
    width: 100%;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #0a2540 0%, #0d2e52 45%, #081a2f 100%);
    padding-bottom: 8vh;
}


/* 1) Canvas network layer (behind) */

#heroNetworkBg {
    position: absolute;
    top: -15vh;
    left: -10vw;
    width: 120vw;
    height: 130vh;
    pointer-events: none;
    opacity: 0.55;
}

#heroNetworkBg canvas {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}


/* 2) Atlas ABOVE the network (covers it) */

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -15px;
    height: min(600px, 92vh);
    z-index: 1;
    pointer-events: none;
    background-image: url("/atlas/app/images/atlas_small_1.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: 110% bottom;
}


/* 3) Readability overlay ABOVE atlas */

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(900px 520px at 50% 34%, rgba(118, 192, 255, 0.08), transparent 62%), linear-gradient(to bottom, rgba(10, 37, 64, 0.35), rgba(10, 37, 64, 0.78));
}


/* 4) Centered content on top */

.hero .hero-content {
    position: relative;
    z-index: 3;
    width: min(820px, 92vw);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}


/* title & subtitle */

.hero h1 {
    margin: 0;
    font-size: clamp(3rem, 6vw, 4.1rem);
    font-weight: 800;
    letter-spacing: .06em;
    color: #fff;
    text-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
}

.hero p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(230, 238, 248, 0.92);
}


/* Buttons aligned with text */

.action-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.action-btn {
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 1.08rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
    border-color: rgba(255, 255, 255, 0.32);
}


/* Dark */

.action-btn.dark {
    background: rgba(10, 37, 64, 0.72);
    color: #fff;
    backdrop-filter: blur(10px);
}

.action-btn.dark:hover {
    background: rgba(29, 61, 108, 0.78);
}


/* Light */

.action-btn.light {
    background: rgba(118, 192, 255, 0.95);
    color: #0a2540;
    border-color: rgba(118, 192, 255, 0.55);
}

.action-btn.light:hover {
    background: rgba(90, 169, 230, 0.98);
    color: #fff;
}


/* Mobile */

@media (max-width: 600px) {
    .action-btn {
        width: min(92vw, 420px);
        min-width: 0;
    }
}


/* Footer: no gap */

footer {
    margin-top: 0 !important;
}


/* =======================
   Pagination (Centered)
======================= */

.pagination {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px auto 60px auto;
    flex-wrap: wrap;
    text-align: center;
}


/* =======================
   Gene Search Bar
======================= */

.gene-search {
    text-align: center;
    margin: 25px 0 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gene-search input {
    width: 50%;
    min-width: 250px;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gene-search input:focus {
    border-color: #76c0ff;
    box-shadow: 0 0 0 3px rgba(118, 192, 255, 0.2);
}

.gene-search button {
    background-color: #0a2540;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.gene-search button:hover {
    background-color: #76c0ff;
    color: #0a2540;
    transform: translateY(-2px);
}


/* =======================
   Network Warning
======================= */

#networkWarning {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(1px);
    z-index: 9999;
}

.warn-box {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 430px;
    font-family: Poppins, sans-serif;
    color: #003366;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
}

.warn-close {
    position: absolute;
    top: 4px;
    right: 10px;
    font-size: 26px;
    cursor: pointer;
    color: #555;
}

.warn-close:hover {
    color: #000;
}


/* =======================
   Network Buttons (color change)
======================= */

#networkWrapper {
    position: relative;
    width: 95%;
    height: 80vh;
    margin: 20px auto;
    border: 2px solid #003366;
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

#networkControls {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    display: inline-flex;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    border: 1px solid #cbd4e1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.net-btn {
    padding: 6px 14px;
    font-size: 13px;
    border: none;
    background: white;
    color: #2a2a2a;
    cursor: pointer;
    border-right: 1px solid #e6e6e6;
    transition: all 0.22s ease;
}

.net-btn:last-child {
    border-right: none;
}

.net-btn:hover {
    background: #f3f7ff;
}

.net-btn.active {
    background: #003366;
    color: white;
    border-right-color: transparent;
}

.net-btn.active:hover {
    background: #003366;
}


/* =======================
   Network color palette
======================= */

#legendToggle {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: #003366;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 21px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

#legendPanel {
    display: none;
    position: absolute;
    top: 60px;
    right: 15px;
    min-width: 330px;
    max-height: 65vh;
    background: white;
    border: 2px solid #003366;
    border-radius: 12px;
    padding: 18px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#legendClose {
    position: absolute;
    right: 6px;
    top: 6px;
    border: none;
    background: #003366;
    color: white;
    border-radius: 5px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-weight: bold;
}

.legendRow {
    display: flex;
    align-items: center;
    padding: 8px 0;
    gap: 10px;
}

.legendColorBox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.4);
}

.legendLabel {
    font-size: 14px;
}


/* =======================
   Clusters enrichment
======================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modalContent {
    background: white;
    border-radius: 14px;
    padding: 20px;
    width: 90vw;
    max-width: 1450px;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.modalImgWrapper {
    flex: 0 0 48%;
    display: flex;
    justify-content: center;
}

.modalImages {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

.modalImages img {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #003366;
}

#modalCloseBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: #003366;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.noImgMsg {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 500;
    padding: 40px 20px;
    color: #003366;
    font-family: "Segoe UI", sans-serif;
    border-radius: 10px;
    background: #f0f6ff;
    border: 2px solid #003366;
}

.clusterImgBtn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 3px 6px;
    color: #003366;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.clusterImgBtn:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.clusterImgBtn:active {
    transform: scale(1.05);
}

.clusterCsvBtn,
.clusterImgBtn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 6px;
    font-size: 16px;
    padding: 3px;
    transition: transform .15s ease;
}

.clusterCsvBtn:hover,
.clusterImgBtn:hover {
    transform: scale(1.2);
}

@media (max-width: 600px) {
    .gene-search input {
        width: 90%;
    }
}

@media(max-width:900px) {
    .modalImages img {
        width: 90%;
    }
    .modalContent {
        width: 95vw;
        max-width: none;
    }
}


/* =======================
   Vanta NET
======================= */

.hero-net {
    position: relative;
    min-height: calc(100vh - 80px);
    width: 100%;
    display: grid;
    place-items: center;
    background: #0a2540;
    overflow: hidden;
}

.hero-net .net-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-net .net-bg {
    background: radial-gradient(900px 520px at 50% 40%, rgba(118, 192, 255, 0.06), transparent 65%), radial-gradient(820px 420px at 50% 45%, rgba(10, 37, 64, 0.04), rgba(10, 37, 64, 0.35));
    opacity: 0.55;
}

.hero-net::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(820px 420px at 50% 45%, rgba(10, 37, 64, 0.12), rgba(10, 37, 64, 0.65));
}

.hero-net .hero-net-inner {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 760px;
    padding: 0 20px;
}

.hero-net h1 {
    font-size: clamp(3rem, 6vw, 4.2rem);
    font-weight: 700;
    letter-spacing: .06em;
    color: #fff;
    margin-bottom: 16px;
    text-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.hero-net p {
    font-size: 1.25rem;
    color: #cfe3f7;
    margin-bottom: 44px;
}

.hero-net-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-net a.net-btn {
    position: relative;
    padding: 16px 42px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: .04em;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s ease, box-shadow .22s ease;
}

.hero-net a.net-btn span {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s ease;
}

.hero-net a.net-btn:hover {
    transform: translateY(-4px);
}

.hero-net a.net-btn:hover span {
    transform: scaleX(1);
}

.hero-net a.net-btn-primary {
    background: #76c0ff;
    color: #0a2540;
    box-shadow: 0 12px 34px rgba(118, 192, 255, 0.35);
}

.hero-net a.net-btn-primary span {
    background: #0a2540;
}

.hero-net a.net-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-net a.net-btn-secondary span {
    background: #76c0ff;
}

@media (max-width: 700px) {
    .hero-net a.net-btn {
        width: 100%;
    }
}


/* =======================
   HOME HERO – Responsive overrides
======================= */

@media (max-width: 900px) {
    #heroNetworkBg {
        top: -10vh;
        left: -14vw;
        width: 128vw;
        height: 120vh;
        opacity: 0.48;
    }
    .hero {
        place-items: start center;
        padding-top: 72px;
        padding-bottom: 10vh;
    }
    .hero .hero-content {
        margin-top: 18px;
    }
    .hero::after {
        bottom: -30px;
        height: min(520px, 70vh);
        background-size: min(780px, 90vw);
        background-position: 100% bottom;
    }
    .action-btn {
        min-width: 180px;
        padding: 12px 24px;
        font-size: 1rem;
    }
}


/* =======================
   HOME HERO – Mobile (<= 600px)
======================= */

@media (max-width: 600px) {
    .hero {
        place-items: start center;
        padding-top: 68px;
        padding-bottom: 16vh;
    }
    .hero .hero-content {
        margin-top: 18px;
        padding-bottom: 0;
    }
    .hero::after {
        bottom: -40px;
        height: 40vh;
        background-size: 105vw;
        background-position: 100% bottom;
    }
    #heroNetworkBg {
        top: -8vh;
        left: -22vw;
        width: 144vw;
        height: 120vh;
        opacity: 0.42;
    }
    .hero h1 {
        font-size: clamp(2.2rem, 9vw, 3rem);
    }
    .hero p {
        font-size: 1.05rem;
    }
    .action-buttons {
        gap: 10px;
        width: 100%;
        margin-top: 22px;
    }
    .action-btn {
        width: min(92vw, 420px);
        min-width: 0;
        padding: 11px 18px;
        font-size: 0.98rem;
    }
}
