/*
 * mentaxonomy Molecular
 * Visual layer for the molecular analysis interface.
 *
 * Loaded after styles.css.
 */


/* Page
-------------------------------------------------- */

body {
    background:
        linear-gradient(
            180deg,
            #f7faf8 0,
            #ffffff 360px
        );
}

.site-main {
    padding-top: 42px;
}


/* Molecular introduction
-------------------------------------------------- */

.molecular-intro {
    position: relative;

    display: flex;
    align-items: center;

    max-width: 980px;
    min-height: 220px;
    margin: -10px 0 38px;
    padding: 34px 38px;

    overflow: hidden;

    background: #f7f8f6;

    border: 1px solid #dfe4df;
    border-radius: 8px;
}

.molecular-intro::before {
    position: absolute;

    top: 50%;
    right: -105px;

    width: 570px;

    aspect-ratio: 3 / 2;

    content: "";

    background:
        linear-gradient(
            90deg,
            rgba(247, 248, 246, 0.96) 0%,
            rgba(247, 248, 246, 0.60) 28%,
            rgba(247, 248, 246, 0.05) 70%
        ),
        url("/assets/images/mentaxonomyhero.png")
        center / contain no-repeat;

    opacity: 0.48;

    transform: translateY(-50%);

    pointer-events: none;
}

.molecular-intro__content {
    position: relative;
    z-index: 1;

    max-width: 650px;
}

.molecular-intro__eyebrow {
    margin: 0 0 9px;

    color: #397c55;

    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.molecular-intro h1 {
    max-width: 620px;
    margin: 0;

    color: #202722;

    font-size: clamp(
        1.9rem,
        3.2vw,
        2.65rem
    );
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.molecular-intro__description {
    max-width: 560px;
    margin: 14px 0 0;

    color: #5d6961;

    font-size: 0.98rem;
    line-height: 1.5;
}

.molecular-intro__sources {
    display: flex;
    align-items: center;
    gap: 0;

    margin-top: 18px;

    color: #397c55;

    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.molecular-intro__sources span {
    padding: 0;

    color: inherit;
    background: none;

    border: 0;
    border-radius: 0;

    font: inherit;
}

.molecular-intro__sources span:not(:last-child)::after {
    content: "·";

    margin: 0 9px;

    color: #94a49a;
}


/* Analysis form
-------------------------------------------------- */

#analysis-form {
    max-width: 980px;
}

#analysis-form > label {
    display: block;

    margin: 24px 0 8px;

    color: #244d38;

    font-size: 0.88rem;
    font-weight: 650;
}

#analysis-form select {
    min-height: 42px;
    margin-top: 0;
    padding: 8px 38px 8px 12px;

    color: #26342c;
    background-color: #fff;

    border: 1px solid #cbd8d0;
    border-radius: 5px;

    font: inherit;
    font-size: 0.92rem;

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

#analysis-form select:hover {
    border-color: #9eb9a8;
}

#analysis-form select:focus {
    border-color: #397c55;

    outline: 0;

    box-shadow:
        0 0 0 3px rgba(57, 124, 85, 0.10);
}


/* Sequence
-------------------------------------------------- */

.sequence-input {
    margin: 0 0 32px;
}

.sequence-input__header {
    margin-bottom: 9px;
}

.sequence-input__header label {
    color: #244d38;

    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sequence-input__clear {
    color: #738078;

    transition: color 120ms ease;
}

.sequence-input__clear:hover {
    color: #397c55;
}

.sequence-drop-zone {
    overflow: hidden;

    background: #fff;

    border: 1px solid #cbd8d0;
    border-radius: 7px;

    box-shadow:
        0 1px 2px rgba(22, 52, 35, 0.025),
        0 5px 18px rgba(22, 52, 35, 0.035);

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        background-color 120ms ease;
}

.sequence-drop-zone:hover {
    border-color: #aac0b1;
}

.sequence-drop-zone:focus-within {
    border-color: #397c55;

    box-shadow:
        0 0 0 3px rgba(57, 124, 85, 0.09),
        0 6px 20px rgba(22, 52, 35, 0.045);
}

.sequence-drop-zone.is-dragging {
    border-color: #397c55;
    background: #f3f8f5;

    box-shadow:
        0 0 0 3px rgba(57, 124, 85, 0.11);
}

.sequence-drop-zone textarea {
    min-height: 270px;
    padding: 22px 24px;

    color: #26342c;

    caret-color: #397c55;

    font-size: 0.9rem;
    line-height: 1.6;
}

.sequence-drop-zone textarea::placeholder {
    color: #8a9990;
}


/* Sequence footer
-------------------------------------------------- */

.sequence-input__footer {
    min-height: 48px;
    padding: 8px 14px;

    background: #f7faf8;

    border-top: 1px solid #e2e9e4;
}

.sequence-input__file-button {
    padding: 6px 8px;

    color: #397c55;

    font-size: 0.82rem;
    font-weight: 700;

    border-radius: 4px;
}

.sequence-input__file-button:hover {
    color: #285f3e;
    background: #edf4ef;

    text-decoration: none;
}

.sequence-input__file-name {
    color: #65736a;
}

.sequence-input__length {
    padding: 3px 7px;

    color: #526158;
    background: #edf3ef;

    border: 1px solid #dde7e0;
    border-radius: 4px;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 0.78rem;
}


/* Drag & drop
-------------------------------------------------- */

.sequence-drop-zone__message {
    color: #286844;
    background: rgba(241, 248, 244, 0.97);

    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}


/* Reference dataset
-------------------------------------------------- */

#dataset {
    width: min(520px, 100%);
}


/* Results
-------------------------------------------------- */

#max_results {
    width: 92px;
}


/* Advanced options
-------------------------------------------------- */

#advanced-options {
    max-width: 760px;
    margin-top: 26px;

    background: #fff;

    border: 1px solid #dbe4de;
    border-radius: 6px;
}

#advanced-options > summary {
    padding: 12px 15px;

    color: #365d47;

    cursor: pointer;

    font-size: 0.86rem;
    font-weight: 650;

    user-select: none;
}

#advanced-options > summary:hover {
    background: #f7faf8;
}

#advanced-options[open] > summary {
    border-bottom: 1px solid #e5ebe7;
}

#advanced-options > :not(summary) {
    margin-left: 16px;
    margin-right: 16px;
}

#advanced-options > :last-child {
    margin-bottom: 16px;
}


/* Primary action
-------------------------------------------------- */

#analyse-button {
    min-width: 132px;
    min-height: 44px;

    margin-top: 28px;
    padding: 10px 22px;

    color: #fff;
    background: #397c55;

    border: 1px solid #397c55;
    border-radius: 5px;

    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;

    box-shadow:
        0 1px 2px rgba(25, 65, 42, 0.12);

    transition:
        background-color 120ms ease,
        border-color 120ms ease,
        box-shadow 120ms ease,
        transform 80ms ease;
}

#analyse-button:hover:not(:disabled) {
    background: #2f6d49;
    border-color: #2f6d49;

    box-shadow:
        0 3px 9px rgba(25, 65, 42, 0.15);
}

#analyse-button:active:not(:disabled) {
    transform: translateY(1px);

    box-shadow:
        0 1px 3px rgba(25, 65, 42, 0.12);
}

#analyse-button:focus-visible {
    outline: 0;

    box-shadow:
        0 0 0 3px rgba(57, 124, 85, 0.16);
}

#analyse-button:disabled {
    color: rgba(255, 255, 255, 0.85);
    background: #71927d;

    border-color: #71927d;
}


/* Loading
-------------------------------------------------- */

.loading {
    margin-top: 22px;

    color: #365d47;

    font-size: 0.9rem;
}

.spinner {
    border-color: #d8e2db;
    border-top-color: #397c55;
}


/* Errors
-------------------------------------------------- */

#analysis-output .error {
    max-width: 760px;
    margin-top: 24px;
    padding: 12px 15px;

    color: #7c2f2f;
    background: #fff7f7;

    border: 1px solid #ecd4d4;
    border-radius: 5px;
}


/* Analysis results
-------------------------------------------------- */

.analysis-result {
    max-width: 1160px;
    margin-top: 42px;
}

.analysis-result h2 {
    color: #244d38;
}

.analysis-summary {
    background: #f5f8f6;

    border-color: #dbe4de;
    border-radius: 6px;
}

.results-table th {
    color: #365d47;
    background: #f5f8f6;
}

.results-table th,
.results-table td {
    border-bottom-color: #dfe6e1;
}

.results-table tbody > tr:not(.result-detail-row):hover {
    background: #f8faf9;
}

.result-detail summary:hover {
    background: #f7faf8;
}

.alignment {
    background: #f7f9f8;

    border-color: #dbe4de;
}


/* Responsive
-------------------------------------------------- */

@media (max-width: 700px) {

    .site-main {
        padding-top: 28px;
    }

    .molecular-intro {
        min-height: 210px;
        margin-top: -4px;
        margin-bottom: 28px;
        padding: 28px 24px;
    }

    .molecular-intro::before {
        right: -230px;

        width: 520px;

        opacity: 0.30;
    }

    .molecular-intro__content {
        max-width: 90%;
    }

    .molecular-intro h1 {
        font-size: clamp(
            1.7rem,
            8vw,
            2.15rem
        );
    }

    .molecular-intro__sources {
        flex-wrap: wrap;
    }

    #analysis-form {
        max-width: none;
    }

    .sequence-input {
        margin-bottom: 26px;
    }

    .sequence-drop-zone textarea {
        min-height: 220px;
        padding: 18px;
    }

    .sequence-input__footer {
        padding: 10px 12px;
    }

    #dataset {
        width: 100%;
    }

    #advanced-options {
        max-width: none;
    }

    #analyse-button {
        width: 100%;
        min-height: 46px;
    }
}