﻿/*
 * Sales Assistant AI — Research Q6
 *
 * Responsibility:
 * - Q6 work-description input
 * - Q6 textarea
 * - Q6 voice prompt
 * - Q6 actions
 * - recommended-length warning
 * - Q6 AI analysis state
 * - Q6 analysis spinner
 * - responsive Q6 presentation
 */

body[data-research-page="true"]
.research-assistant__q6-input {
    width: min(100%, 48rem) !important;
    margin-inline: 0;
}

body[data-research-page="true"]
.research-assistant__q6-textarea {
    box-sizing: border-box;

    width: 100%;
    max-width: none;
    height: 11rem;
    min-height: 11rem;
    margin-inline: 0;

    resize: vertical;
}

body[data-research-page="true"]
.research-assistant__q6-meta {
    width: 100%;
}

/*
 * Conditional voice prompt
 *
 * This appears only when voice features were not selected in Q5.
 * It invites the participant to try the existing Q6 recording control
 * without turning the prompt into another research question.
 */

body[data-research-page="true"]
.research-assistant__q6-voice-prompt {
    box-sizing: border-box;

    width: min(100%, 48rem);
    margin: -0.45rem 0 1.25rem;
    padding: 1rem 1.1rem;

    border: 1px solid rgba(168, 85, 247, 0.28);
    border-radius: 0.9rem;

    background:
        linear-gradient(
            145deg,
            rgba(91, 33, 116, 0.28),
            rgba(52, 27, 82, 0.18)
        );

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.025),
        0 12px 30px rgba(18, 8, 27, 0.14);
}

body[data-research-page="true"]
.research-assistant__q6-voice-prompt-title {
    margin: 0;

    color: var(--color-text-primary);

    font-size: 0.92rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.35;
}

body[data-research-page="true"]
.research-assistant__q6-voice-prompt-description {
    max-width: 42rem;
    margin: 0.35rem 0 0;

    color: var(--color-text-secondary);

    font-size: 0.82rem;
    line-height: 1.5;
}

body[data-research-page="true"]
.research-assistant__q6-actions {
    box-sizing: border-box;

    width: min(100%, 48rem) !important;
    margin-inline: 0;

    justify-content: flex-start !important;
}

body[data-research-page="true"]
.research-assistant__q6-voice {
    justify-content: flex-start !important;
}

body[data-research-page="true"]
.research-assistant__q6-voice-button,
body[data-research-page="true"]
.research-assistant__q6-actions
.research-assistant__next {
    min-height: 3rem;
}

/*
 * Lift only the Q6 Next button to the voice-control row.
 */

@media (min-width: 769px) {
    body[data-research-page="true"]
    .research-assistant__q6-actions
    > .research-assistant__next {
        position: relative;
        top: -4rem;
    }
}

/*
 * Recommended-length warning
 */

body[data-research-page="true"]
.research-assistant__q6-counter--over-limit {
    color: #b42318;
    font-weight: 700;
}

/*
 * AI answer analysis state
 */

body[data-research-page="true"]
.research-assistant__q6-analysis {
    position: fixed;
    z-index: 1000;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;

    box-sizing: border-box;

    width: min(90vw, 34rem);
    min-height: 15rem;

    margin: 0;
    padding: 2rem;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.25rem;

    background: rgba(15, 18, 24, 0.96);

    box-shadow:
        0 1.5rem 4rem rgba(0, 0, 0, 0.38);

    text-align: center;
}

body[data-research-page="true"]
.research-assistant__q6-analysis-spinner {
    position: relative;

    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    width: 7.25rem;
    height: 7.25rem;
}

body[data-research-page="true"]
.research-assistant__q6-analysis-spinner-ring {
    position: absolute;
    inset: 0;

    box-sizing: border-box;

    border: 4px solid rgba(255, 255, 255, 0.16);
    border-top-color: #ffffff;
    border-right-color: #d4af37;
    border-bottom-color: rgba(212, 175, 55, 0.42);
    border-radius: 50%;

    box-shadow:
        0 0 1.4rem rgba(212, 175, 55, 0.12);

    animation:
        research-q6-analysis-spin
        1.1s linear infinite;
}

body[data-research-page="true"]
.research-assistant__q6-analysis-spinner-logo-plate {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    width: 5.875rem;
    height: 5.875rem;
    padding: 0.95rem 0.65rem;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;

    background:
        linear-gradient(
            180deg,
            #102b45 0%,
            #081b2d 100%
        );

    box-shadow:
        0 0.5rem 1.4rem rgba(0, 0, 0, 0.22);
}

body[data-research-page="true"]
.research-assistant__q6-analysis-spinner-logo {
    display: block;

    width: 100%;
    height: auto;
    max-height: 3.4rem;

    object-fit: contain;
}

body[data-research-page="true"]
.research-assistant__q6-analysis-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

body[data-research-page="true"]
.research-assistant__q6-analysis-title {
    font-size: 1.08rem;
    line-height: 1.4;
}

body[data-research-page="true"]
.research-assistant__q6-analysis-description {
    max-width: 27rem;

    color: var(--color-text-secondary);

    font-size: 0.92rem;
    line-height: 1.5;
}

@keyframes research-q6-analysis-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-research-page="true"]
    .research-assistant__q6-analysis-spinner-ring {
        animation: none;
    }
}

@media (max-width: 768px) {
    body[data-research-page="true"]
    .research-assistant__q6-voice-prompt {
        margin-top: -0.25rem;
        padding: 0.9rem 1rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-textarea {
        height: 10rem;
        min-height: 10rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-actions {
        align-items: stretch !important;
    }

    body[data-research-page="true"]
    .research-assistant__q6-actions
    .research-assistant__q6-voice,
    body[data-research-page="true"]
    .research-assistant__q6-actions
    .research-assistant__next {
        flex: 1 1 12rem;
    }
}

@media (max-width: 520px) {
    body[data-research-page="true"]
    .research-assistant__q6-voice-prompt {
        width: 100%;
        margin-bottom: 1rem;
        padding: 0.85rem 0.9rem;

        border-radius: 0.8rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-voice-prompt-title {
        font-size: 0.88rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-voice-prompt-description {
        font-size: 0.8rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-analysis {
        width: min(92vw, 34rem);
        min-height: 14rem;
        padding: 1.5rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-analysis-spinner {
        width: 6.5rem;
        height: 6.5rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-analysis-spinner-logo-plate {
        width: 5.25rem;
        height: 5.25rem;
        padding: 0.85rem 0.6rem;
    }

    body[data-research-page="true"]
    .research-assistant__q6-analysis-spinner-logo {
        max-height: 3rem;
    }
}



/*
 * Q6 standard action alignment.
 * Keep Next aligned left like the other Research questions.
 */
body[data-research-page="true"]
.research-assistant__q6-actions {
    justify-content: flex-start !important;
}

body[data-research-page="true"]
.research-assistant__q6-actions
> .research-assistant__next {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-self: flex-start !important;
}
