﻿/*
 * Sales Assistant AI — Research Layout
 *
 * Responsibility:
 * - research page viewport
 * - workspace shell
 * - workspace header
 * - branding
 * - close action
 * - progress bar
 * - scrollable main content area
 * - research content width
 * - premium workspace footer
 *
 * Feature-specific Research styles belong in separate modules.
 */

body[data-research-page="true"] {
    height: 100vh;
    min-height: 100vh;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(79, 140, 255, 0.07),
            transparent 34rem
        ),
        var(--color-background);
}

body[data-research-page="true"]
.research-workspace {
    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100vh;
    min-height: 0;

    overflow: hidden;
}

body[data-research-page="true"]
.research-workspace__header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;

    min-height: 4.75rem;
    padding-inline: clamp(1.5rem, 5vw, 6rem);

    border-bottom: 1px solid var(--color-border);
    background: rgba(8, 17, 31, 0.9);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body[data-research-page="true"]
.research-workspace__brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

body[data-research-page="true"]
.research-workspace__brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 2.15rem;
    height: 2.15rem;

    border: 1px solid rgba(79, 140, 255, 0.3);
    border-radius: 0.65rem;

    background: rgba(79, 140, 255, 0.09);
    color: var(--color-accent);

    font-size: 0.75rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.05em;
}

body[data-research-page="true"]
.research-workspace__brand > div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

body[data-research-page="true"]
.research-workspace__brand strong {
    color: var(--color-text-primary);

    font-size: 0.95rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.015em;
}

body[data-research-page="true"]
.research-workspace__brand div span {
    color: var(--color-text-muted);

    font-size: 0.72rem;
}

body[data-research-page="true"]
.research-workspace__brand-logo {
    display: block;

    width: auto !important;
    height: 3rem !important;
    max-width: 14rem !important;
    max-height: 3rem !important;

    object-fit: contain;
}

body[data-research-page="true"]
.research-workspace__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;

    min-height: 2.4rem;
    padding: 0.55rem 0.8rem;

    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.65rem;

    background: rgba(255, 255, 255, 0.025);
    color: var(--color-text-secondary);

    font: inherit;
    font-size: 0.78rem;
    font-weight: var(--font-weight-semibold);

    cursor: pointer;

    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast);
}

body[data-research-page="true"]
.research-workspace__close:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-primary);
}

body[data-research-page="true"]
.research-workspace__close > span:first-child {
    font-size: 1rem;
    line-height: 1;
}

body[data-research-page="true"]
.research-workspace__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    min-height: 0;

    overflow: hidden;
}

body[data-research-page="true"]
.research-workspace__progress {
    flex: 0 0 auto;

    width: 100%;
    height: 2px;

    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
}

body[data-research-page="true"]
.research-workspace__progress-bar {
    width: 0;
    height: 100%;

    background: var(--color-accent);

    transition:
        width 220ms ease;
}

body[data-research-page="true"]
.research-workspace__content {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;

    width: 100%;
    min-height: 0;

    padding:
        clamp(1.5rem, 3vh, 2.5rem)
        clamp(1.25rem, 4vw, 3rem)
        clamp(1.5rem, 3vh, 2.5rem);

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

body[data-research-page="true"]
.research-assistant {
    width: min(100%, 72rem);
    min-height: 100%;

    margin-inline: auto;
}


/* ==========================================================================
   Premium Research footer
   ========================================================================== */

body[data-research-page="true"]
.research-workspace__footer {
    position: relative;

    display: grid;
    flex: 0 0 auto;
    grid-template-columns:
        minmax(9rem, 1fr)
        auto
        minmax(9rem, 1fr);

    align-items: center;
    column-gap: clamp(1rem, 2vw, 2rem);
    row-gap: 0.25rem;

    min-height: 3.2rem;
    padding:
        0.45rem
        clamp(1.5rem, 5vw, 6rem);

    border-top: 1px solid rgba(212, 175, 55, 0.28);

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(212, 175, 55, 0.035),
            transparent 20rem
        ),
        rgba(8, 17, 31, 0.96);

    color: var(--color-text-muted);

    font-size: 0.7rem;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

body[data-research-page="true"]
.research-workspace__footer::before {
    position: absolute;
    top: -1px;
    left: 50%;

    width: min(24rem, 45vw);
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(212, 175, 55, 0.7),
            transparent
        );

    content: "";
    pointer-events: none;

    transform: translateX(-50%);
}

body[data-research-page="true"]
.research-workspace__footer > span:first-child {
    grid-column: 1;
    grid-row: 1;

    justify-self: start;

    color: var(--color-text-muted);

    white-space: nowrap;
}

body[data-research-page="true"]
.research-workspace__footer > span:last-child {
    grid-column: 3;
    grid-row: 1;

    justify-self: end;

    color: rgba(212, 175, 55, 0.82);

    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.01em;

    text-align: right;
    white-space: nowrap;
}

body[data-research-page="true"]
.research-workspace__footer-legal {
    grid-column: 2;
    grid-row: 1;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap:
        0.25rem
        0.45rem;

    justify-self: center;

    max-width: 48rem;

    text-align: center;
}

body[data-research-page="true"]
.research-workspace__footer-legal a {
    padding:
        0.2rem
        0.12rem;

    color: var(--color-text-secondary);

    font-size: 0.69rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.35;

    text-decoration: none;

    transition:
        color var(--transition-fast),
        text-shadow var(--transition-fast);
}

body[data-research-page="true"]
.research-workspace__footer-legal a:hover,
body[data-research-page="true"]
.research-workspace__footer-legal a:focus-visible {
    color: #f1d779;

    text-shadow:
        0 0 0.9rem rgba(212, 175, 55, 0.16);
}

body[data-research-page="true"]
.research-workspace__footer-legal a:focus-visible {
    border-radius: 0.2rem;

    outline: 1px solid rgba(212, 175, 55, 0.5);
    outline-offset: 0.15rem;
}

body[data-research-page="true"]
.research-workspace__footer-legal > span {
    color: rgba(212, 175, 55, 0.48);

    font-size: 0.64rem;

    user-select: none;
}


@media (max-width: 900px) {
    body[data-research-page="true"]
    .research-workspace__footer {
        grid-template-columns: 1fr;
        gap: 0.25rem;

        min-height: 4.8rem;
        padding-block: 0.55rem;

        text-align: center;
    }

    body[data-research-page="true"]
    .research-workspace__footer > span:first-child {
        grid-column: 1;
        grid-row: 2;

        justify-self: center;
    }

    body[data-research-page="true"]
    .research-workspace__footer > span:last-child {
        grid-column: 1;
        grid-row: 3;

        justify-self: center;

        text-align: center;
    }

    body[data-research-page="true"]
    .research-workspace__footer-legal {
        grid-column: 1;
        grid-row: 1;

        justify-self: center;
    }
}


@media (max-width: 768px) {
    body[data-research-page="true"] {
        height: 100dvh;
        min-height: 100dvh;
    }

    body[data-research-page="true"]
    .research-workspace {
        height: 100dvh;
    }

    body[data-research-page="true"]
    .research-workspace__header {
        min-height: 4.25rem;
        padding-inline: 1rem;
    }

    body[data-research-page="true"]
    .research-workspace__brand div span {
        display: none;
    }

    body[data-research-page="true"]
    .research-workspace__brand-logo {
        height: 2.5rem !important;
        max-width: 11rem !important;
        max-height: 2.5rem !important;
    }

    body[data-research-page="true"]
    .research-workspace__content {
        padding:
            1rem
            1rem
            1rem;
    }

    body[data-research-page="true"]
    .research-workspace__footer {
        gap: 0.3rem;

        min-height: 4.6rem;
        padding:
            0.5rem
            1rem;
    }

    body[data-research-page="true"]
    .research-workspace__footer-legal {
        gap:
            0.2rem
            0.35rem;

        max-width: 32rem;
    }

    body[data-research-page="true"]
    .research-workspace__footer-legal a {
        font-size: 0.65rem;
    }
}


@media (max-width: 520px) {
    body[data-research-page="true"]
    .research-workspace__brand-mark {
        width: 2rem;
        height: 2rem;
    }

    body[data-research-page="true"]
    .research-workspace__close-label {
        display: none;
    }

    body[data-research-page="true"]
    .research-workspace__close {
        width: 2.4rem;
        padding: 0;
    }

    body[data-research-page="true"]
    .research-workspace__footer {
        min-height: 4.25rem;
        padding:
            0.45rem
            0.75rem;
    }

    body[data-research-page="true"]
    .research-workspace__footer > span:first-child {
        display: none;
    }

    body[data-research-page="true"]
    .research-workspace__footer > span:last-child {
        display: none;
    }

    body[data-research-page="true"]
    .research-workspace__footer-legal {
        width: 100%;
        max-width: 22rem;

        gap:
            0.15rem
            0.3rem;
    }

    body[data-research-page="true"]
    .research-workspace__footer-legal a {
        font-size: 0.62rem;
        line-height: 1.3;
    }

    body[data-research-page="true"]
    .research-workspace__footer-legal > span {
        font-size: 0.58rem;
    }
}