/* Mock interview — modern coach UI (core API stays on Jobserver PHP) */

.mock-interview-block {
    position: relative;
    margin: 14px 10px 20px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgb(99 102 241 / 22%);
    font-family: Urbanist, Hubballi, sans-serif;
}

.mock-interview-block__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 20% 0%, rgb(34 197 94 / 18%), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 100%, rgb(99 102 241 / 20%), transparent 50%),
        linear-gradient(135deg, #f8fafc, #eef2ff 45%, #ecfdf5);
    pointer-events: none;
}

body.dark .mock-interview-block__glow {
    background: radial-gradient(ellipse 80% 60% at 20% 0%, rgb(34 197 94 / 12%), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 100%, rgb(99 102 241 / 15%), transparent 50%),
        linear-gradient(135deg, #0f172a, #1e1b2e 50%, #0f1a14);
}

.mock-interview-block__content {
    position: relative;
    padding: 18px 20px;
}

.mock-interview-block__head h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mock-interview-block__head p {
    margin: 0;
    font-family: Hubballi, sans-serif;
    line-height: 1.5;
    font-size: 0.95rem;
    max-width: 52ch;
}

.mock-interview-block__actions {
    margin-top: 14px;
}

.mock-interview-open--hero {
    font-weight: 800;
    border-radius: 999px;
    padding: 10px 18px;
}

.mock-interview-trigger--list {
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 999px;
    font-family: Hubballi, Urbanist, sans-serif;
    font-weight: 800;
}

body.dark .mock-interview-trigger--list {
    color: #eafff2;
}

/* Dialog */
.mock-interview-dialog {
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: none;
    background: transparent;
}

.mock-interview-dialog::backdrop {
    background: rgb(15 23 42 / 62%);
    backdrop-filter: blur(6px);
}

.mock-interview-dialog__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(980px, 100vw);
    height: min(92vh, 900px);
    max-height: min(92vh, 900px);
    margin: auto;
    margin-top: max(2vh, 12px);
    margin-bottom: max(2vh, 12px);
    border-radius: 20px;
    overflow: hidden;
    min-height: 0;
    background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 40%, #eef2ff 100%);
    box-shadow: 0 32px 80px rgb(15 23 42 / 35%);
    font-family: Urbanist, Hubballi, sans-serif;
    color: #0f172a;
}

body.dark .mock-interview-dialog__inner {
    background: linear-gradient(160deg, #1a1524 0%, #12101a 45%, #0f172a 100%);
    color: #f1f5f9;
}

.mock-interview-dialog__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgb(148 163 184 / 25%);
    flex: 0 0 auto;
}

body.dark .mock-interview-dialog__header {
    border-color: rgb(71 85 105 / 40%);
}

.mock-interview-dialog__eyebrow {
    margin: 0 0 2px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6366f1;
    font-weight: 700;
}

.mock-interview-dialog__header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.mock-interview-dialog__sub {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #64748b;
}

body.dark .mock-interview-dialog__sub {
    color: #94a3b8;
}

.mock-interview-dialog__header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mock-interview-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgb(148 163 184 / 35%);
    background: rgb(255 255 255 / 70%);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    color: inherit;
}

body.dark .mock-interview-icon-btn {
    background: rgb(30 41 59 / 60%);
    border-color: rgb(71 85 105 / 50%);
}

.mock-interview-icon-btn[aria-pressed="true"] {
    opacity: 0.65;
}

.mock-interview-icon-btn__label {
    font-family: Hubballi, sans-serif;
}

.mock-interview-dialog__close {
    border: none;
    background: rgb(148 163 184 / 20%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
}

/* Layout — flex column on mobile; grid on desktop; panel scrolls, compose pinned */
.mock-interview-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .mock-interview-layout {
        display: grid;
        grid-template-columns: minmax(240px, 36%) 1fr;
        grid-template-rows: minmax(0, 1fr);
    }
}

.mock-interview-stage {
    flex: 0 0 auto;
    padding: 12px 16px 14px;
    background: linear-gradient(180deg, rgb(99 102 241 / 8%), transparent 70%);
    border-bottom: 1px solid rgb(148 163 184 / 20%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .mock-interview-stage {
        padding: 16px 18px 20px;
        border-bottom: none;
        border-right: 1px solid rgb(148 163 184 / 20%);
        align-items: stretch;
        text-align: left;
        min-height: 0;
        overflow-y: auto;
    }
}

body.dark .mock-interview-stage {
    background: linear-gradient(180deg, rgb(99 102 241 / 12%), transparent 70%);
    border-color: rgb(71 85 105 / 35%);
}

.mock-interview-orb-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.mock-interview-orb-host {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgb(255 255 255 / 90%), rgb(226 232 240 / 50%));
    box-shadow: 0 12px 40px rgb(99 102 241 / 18%), inset 0 0 0 1px rgb(255 255 255 / 60%);
}

body.dark .mock-interview-orb-host {
    background: radial-gradient(circle at 30% 30%, rgb(51 65 85 / 80%), rgb(15 23 42 / 90%));
    box-shadow: 0 12px 40px rgb(0 0 0 / 35%), inset 0 0 0 1px rgb(148 163 184 / 15%);
}

.mock-interview-orb-host canvas {
    display: block !important;
    width: 72px !important;
    height: 72px !important;
}

@media (min-width: 768px) {
    .mock-interview-orb-host {
        width: 112px;
        height: 112px;
    }

    .mock-interview-orb-host canvas {
        width: 88px !important;
        height: 88px !important;
    }
}

.mock-interview-orb-host--lottie {
    background: radial-gradient(circle at 50% 45%, rgb(99 102 241 / 12%), transparent 70%);
}

.mock-interview-lottie {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mock-interview-lottie svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 96px;
    max-height: 96px;
}

.mock-interview-stage-status {
    margin: 0 0 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

body.dark .mock-interview-stage-status {
    color: #a5b4fc;
}

.mock-interview-progress {
    width: 100%;
    margin-bottom: 12px;
    font-size: 0.75rem;
    color: #64748b;
}

.mock-interview-progress__bar {
    height: 5px;
    border-radius: 999px;
    background: rgb(148 163 184 / 35%);
    margin-top: 6px;
    overflow: hidden;
}

.mock-interview-progress__bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22c55e, #6366f1);
    transition: width 0.35s ease;
}

.mock-interview-question-card {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgb(255 255 255 / 75%);
    border: 1px solid rgb(148 163 184 / 28%);
    box-shadow: 0 8px 24px rgb(15 23 42 / 6%);
    min-height: 0;
    max-height: 22vh;
    overflow-y: auto;
}

body.dark .mock-interview-question-card {
    background: rgb(30 41 59 / 55%);
    border-color: rgb(71 85 105 / 45%);
}

.mock-interview-question-meta {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.mock-interview-question-text {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.5;
    font-family: Hubballi, Urbanist, sans-serif;
}

@media (min-width: 768px) {
    .mock-interview-question-text {
        font-size: 1.12rem;
    }
}

/* Panel — timeline scrolls; compose always visible at bottom */
.mock-interview-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.mock-interview-timeline {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 48px;
    -webkit-overflow-scrolling: touch;
}

.mock-interview-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    animation: mockInterviewFadeIn 0.35s ease;
}

@keyframes mockInterviewFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mock-interview-bubble__label {
    margin: 0 0 4px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    font-weight: 800;
}

.mock-interview-bubble--you {
    align-self: flex-end;
    max-width: 92%;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 1px solid rgb(34 197 94 / 25%);
}

.mock-interview-bubble--feedback {
    background: linear-gradient(135deg, #eff6ff, #e0e7ff);
    border: 1px solid rgb(99 102 241 / 22%);
}

.mock-interview-bubble--coach {
    background: rgb(241 245 249 / 90%);
    border: 1px solid rgb(148 163 184 / 25%);
}

body.dark .mock-interview-bubble--you {
    background: linear-gradient(135deg, #14532d, #166534);
    border-color: rgb(34 197 94 / 30%);
}

body.dark .mock-interview-bubble--feedback {
    background: linear-gradient(135deg, #1e3a5f, #312e81);
    border-color: rgb(99 102 241 / 35%);
}

body.dark .mock-interview-bubble--coach {
    background: rgb(30 41 59 / 80%);
}

.mock-interview-star {
    white-space: pre-wrap;
    font-family: Hubballi, sans-serif;
    font-size: 0.85rem;
}

.mock-interview-score-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

/* Compose */
.mock-interview-compose {
    flex: 0 0 auto;
    padding: 12px 14px max(16px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgb(148 163 184 / 25%);
    background: rgb(248 250 252 / 95%);
    box-shadow: 0 -10px 28px rgb(15 23 42 / 8%);
    z-index: 2;
}

body.dark .mock-interview-compose {
    background: rgb(15 23 42 / 50%);
    border-color: rgb(71 85 105 / 40%);
}

.mock-interview-field {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.mock-interview-compose textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid rgb(148 163 184 / 45%);
    padding: 12px;
    font-family: Hubballi, sans-serif;
    font-size: 0.95rem;
    resize: none;
    min-height: 72px;
    max-height: 28vh;
    background: #fff;
}

body.dark .mock-interview-compose textarea {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

.mock-interview-compose__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.mock-interview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgb(148 163 184 / 45%);
    background: #fff;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    color: inherit;
    font-family: Hubballi, Urbanist, sans-serif;
}

body.dark .mock-interview-btn {
    background: #1e293b;
    border-color: #475569;
}

.mock-interview-btn--record[aria-pressed="true"] {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

body.dark .mock-interview-btn--record[aria-pressed="true"] {
    background: #450a0a;
    color: #fecaca;
}

.mock-interview-btn--primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: #fff;
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
}

.mock-interview-dialog__footer {
    margin-top: 4px;
}

.mock-interview-record-status {
    font-size: 0.8rem;
    color: #64748b;
}

/* Loading overlay */
.mock-interview-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgb(15 23 42 / 40%);
    backdrop-filter: blur(4px);
    z-index: 5;
}

.mock-interview-loading:not([hidden]) {
    display: flex;
}

.mock-interview-loading__card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    background: #fff;
    font-weight: 700;
    box-shadow: 0 16px 48px rgb(0 0 0 / 20%);
}

body.dark .mock-interview-loading__card {
    background: #1e293b;
}

.mock-interview-loading__pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6366f1;
    animation: mockInterviewPulse 1s ease infinite;
}

@keyframes mockInterviewPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.5; }
}

.mock-interview-error {
    color: #b91c1c;
    font-size: 0.88rem;
    margin: 0;
    padding: 8px 18px 14px;
}

body.dark .mock-interview-error {
    color: #fca5a5;
}

.mock-interview-error:not([hidden]) {
    display: block;
}

/* Mobile: true full-screen coach (no floating card) */
@media (max-width: 767px) {
    html.mock-interview-fs-active,
    html.mock-interview-fs-active body {
        overflow: hidden;
        overscroll-behavior: none;
        height: 100%;
    }

    .mock-interview-dialog[open] {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: 0;
    }

    .mock-interview-dialog[open]::backdrop {
        background: #0f172a;
        backdrop-filter: none;
    }

    .mock-interview-dialog[open] .mock-interview-dialog__inner {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        margin: 0;
        border-radius: 0;
        padding-top: max(8px, env(safe-area-inset-top, 0px));
        padding-bottom: 0;
        padding-left: max(0px, env(safe-area-inset-left, 0px));
        padding-right: max(0px, env(safe-area-inset-right, 0px));
    }

    .mock-interview-stage-status {
        margin-bottom: 8px;
    }

    .mock-interview-progress {
        margin-bottom: 8px;
    }

    .mock-interview-question-text {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .mock-interview-dialog__header {
        padding: 10px 14px 8px;
    }

    .mock-interview-icon-btn__label {
        display: none;
    }

    .mock-interview-error {
        flex: 0 0 auto;
        padding: 6px 14px 10px;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    .mock-interview-dialog[open] .mock-interview-dialog__inner {
        height: 100%;
        max-height: 100%;
    }

    .mock-interview-layout {
        flex-direction: row;
    }

    .mock-interview-stage {
        width: 38%;
        max-width: 42%;
        border-right: 1px solid rgb(148 163 184 / 20%);
        border-bottom: none;
        overflow-y: auto;
    }

    .mock-interview-panel {
        width: 62%;
        min-width: 0;
    }

    .mock-interview-question-card {
        max-height: 35vh;
    }
}
