/* ==========================================================================
   mentaxonomy · MTAX Viewer
   ========================================================================== */


/* --------------------------------------------------------------------------
   Viewer layout
   -------------------------------------------------------------------------- */

.viewer {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}


/* --------------------------------------------------------------------------
   Viewer hero
   -------------------------------------------------------------------------- */

.viewer > .molecular-intro {
    width: 100%;
    max-width: 980px;

    margin-left: auto;
    margin-right: auto;
}


/* --------------------------------------------------------------------------
   Open document panel
   -------------------------------------------------------------------------- */

.viewer-open {
    box-sizing: border-box;

    width: 100%;
    max-width: 980px;

    margin: 3rem auto 5rem;
    padding: 2.25rem;

    border: 1px solid #dce5df;
    border-radius: 8px;

    background: #fff;

    box-shadow:
        0 1px 2px rgba(20, 45, 31, .03),
        0 10px 32px rgba(20, 45, 31, .035);
}

.viewer-open__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;

    margin-bottom: 1.6rem;
}

.viewer-open__eyebrow {
    margin: 0 0 .35rem;

    color: #728078;

    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.viewer-open__header h2 {
    margin: 0;

    color: #17231c;

    font-size: 1.55rem;
    line-height: 1.2;
}

.viewer-open__format {
    flex: 0 0 auto;

    padding: .35rem .55rem;

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

    background: #f7faf8;
    color: #3f8661;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        "Courier New",
        monospace;

    font-size: .78rem;
    font-weight: 700;
}


/* --------------------------------------------------------------------------
   MTAX drop zone
   -------------------------------------------------------------------------- */

.mtax-drop-zone {
    position: relative;

    box-sizing: border-box;
    width: 100%;
    min-height: 300px;

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

    padding: 3rem 2rem;
    overflow: hidden;

    border: 2px dashed #b9ccc0;
    border-radius: 7px;

    background:
        linear-gradient(
            180deg,
            rgba(246, 250, 247, .92),
            rgba(250, 252, 250, .96)
        );

    cursor: pointer;

    transition:
        border-color .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

.mtax-drop-zone:hover,
.mtax-drop-zone:focus-visible {
    border-color: #6e9f81;

    outline: none;

    box-shadow:
        0 0 0 3px rgba(63, 134, 97, .08);
}

.mtax-drop-zone--dragging {
    border-color: #3f8661;

    background: #f1f7f3;

    box-shadow:
        inset 0 0 0 1px rgba(63, 134, 97, .1),
        0 0 0 4px rgba(63, 134, 97, .08);
}


/* --------------------------------------------------------------------------
   Native file input
   -------------------------------------------------------------------------- */

.mtax-drop-zone > input[type="file"] {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* --------------------------------------------------------------------------
   Drop zone content
   -------------------------------------------------------------------------- */

.mtax-drop-zone__content {
    position: relative;
    z-index: 1;

    max-width: 520px;

    text-align: center;
}

.mtax-drop-zone__icon {
    width: 76px;
    height: 76px;

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

    margin: 0 auto 1.35rem;

    border: 1px solid #d8e4dc;
    border-radius: 8px;

    background: #fff;
    color: #3f8661;

    box-shadow:
        0 5px 18px rgba(30, 73, 47, .05);
}

.mtax-drop-zone__title {
    margin: 0;

    color: #1d2a22;

    font-size: 1.3rem;
    font-weight: 700;
}

.mtax-drop-zone__description {
    margin: .5rem 0 1.5rem;

    color: #758078;

    font-size: .95rem;
}


/* --------------------------------------------------------------------------
   Choose file button
   -------------------------------------------------------------------------- */

.mtax-drop-zone__button {
    min-height: 44px;

    padding: .7rem 1.2rem;

    border: 1px solid #3f8661;
    border-radius: 5px;

    background: #fff;
    color: #347553;

    font: inherit;
    font-size: .92rem;
    font-weight: 650;

    cursor: pointer;

    transition:
        background-color .15s ease,
        color .15s ease,
        box-shadow .15s ease;
}

.mtax-drop-zone__button:hover {
    background: #f1f7f3;
}

.mtax-drop-zone__button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(63, 134, 97, .14);
}


/* --------------------------------------------------------------------------
   Drag overlay
   -------------------------------------------------------------------------- */

.mtax-drop-zone__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;

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

    background: rgba(241, 247, 243, .96);

    color: #347553;

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

    opacity: 0;
    pointer-events: none;

    transition: opacity .15s ease;
}

.mtax-drop-zone--dragging
.mtax-drop-zone__overlay {
    opacity: 1;
}


/* --------------------------------------------------------------------------
   Selected document
   -------------------------------------------------------------------------- */

.mtax-selection {
    box-sizing: border-box;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;

    margin-top: 1rem;
    padding: 1rem 1.15rem;

    border: 1px solid #dce5df;
    border-radius: 6px;

    background: #fafcfb;
}

.mtax-selection[hidden] {
    display: none;
}

.mtax-selection__document {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: .85rem;
}

.mtax-selection__icon {
    flex: 0 0 auto;

    width: 42px;
    height: 42px;

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

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

    background: #fff;
    color: #3f8661;
}

.mtax-selection__document > div {
    min-width: 0;
}

.mtax-selection__document strong {
    display: block;
    overflow: hidden;

    color: #243129;

    font-size: .93rem;
    font-weight: 650;

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

.mtax-selection__document
span:not(.mtax-selection__icon) {
    display: block;

    margin-top: .15rem;

    color: #7a847e;

    font-size: .78rem;
}

.mtax-selection__clear {
    flex: 0 0 auto;

    padding: .35rem .2rem;

    border: 0;

    background: transparent;
    color: #6d7771;

    font: inherit;
    font-size: .84rem;
    font-weight: 600;

    cursor: pointer;
}

.mtax-selection__clear:hover {
    color: #2f6f4e;
    text-decoration: underline;
}


/* --------------------------------------------------------------------------
   Open analysis button
   -------------------------------------------------------------------------- */

.viewer-open-button {
    min-width: 190px;
    min-height: 50px;

    margin-top: 1.5rem;
    padding: .8rem 1.4rem;

    border: 0;
    border-radius: 6px;

    background: #3f8661;
    color: #fff;

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

    cursor: pointer;

    box-shadow:
        0 3px 8px rgba(34, 91, 57, .13);

    transition:
        background-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.viewer-open-button:hover:not(:disabled) {
    background: #347553;

    box-shadow:
        0 5px 12px rgba(34, 91, 57, .17);
}

.viewer-open-button:active:not(:disabled) {
    transform: translateY(1px);
}

.viewer-open-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 3px rgba(63, 134, 97, .18),
        0 3px 8px rgba(34, 91, 57, .13);
}

.viewer-open-button:disabled {
    background: #aab8af;

    box-shadow: none;

    cursor: not-allowed;
}


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

.viewer-error {
    margin: 1rem 0;
    padding: .9rem 1rem;

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

    background: #fff7f6;
    color: #8b3632;

    font-size: .9rem;
    line-height: 1.5;
}

.viewer-error[hidden] {
    display: none;
}


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

@media (max-width: 1028px) {

    .viewer > .molecular-intro,
    .viewer-open {
        width: calc(100% - 2rem);
    }

}

@media (max-width: 720px) {

    .viewer-open {
        margin-top: 2rem;
        margin-bottom: 3rem;
        padding: 1.4rem;
    }

    .viewer-open__header {
        gap: 1rem;
    }

    .mtax-drop-zone {
        min-height: 260px;
        padding: 2.25rem 1.25rem;
    }

    .mtax-selection {
        align-items: flex-start;
    }

    .viewer-open-button {
        width: 100%;
    }

}