/**
 * ExamSim Prompt Studio — Custom Styles
 */

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
    background-color: #f8f9fa;
    font-size: 0.9rem;
}

/* ── Navigation ────────────────────────────────────────────────────────────── */
.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* ── Streaming cursor ──────────────────────────────────────────────────────── */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.streaming-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: #6c757d;
    margin-left: 2px;
}

/* ── Chat bubbles (simulate.php) ───────────────────────────────────────────── */
#chatArea {
    min-height: 300px;
}

#chatArea .card {
    border-radius: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#chatArea .msg-content {
    line-height: 1.5;
    word-break: break-word;
}

/* Avatar bubble on the left */
#chatArea .d-flex:not(.justify-content-end) .card {
    border-top-left-radius: 0.25rem;
}

/* User bubble on the right */
#chatArea .justify-content-end .card {
    border-top-right-radius: 0.25rem;
}

/* ── Wizard steps — visibility controlled via Bootstrap d-none by wizard.js ── */

/* Step indicator pills */
.step-indicator {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.step-pill {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background-color: #dee2e6;
    transition: background-color 0.3s;
}

.step-pill.active {
    background-color: #0d6efd;
}

.step-pill.done {
    background-color: #198754;
}

/* ── Sliders ───────────────────────────────────────────────────────────────── */
.slider-group label {
    font-size: 0.82rem;
    color: #495057;
}

.slider-value-badge {
    min-width: 1.8rem;
    text-align: center;
}

input[type="range"] {
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    background: #0d6efd;
}

/* ── Prompt preview textarea ───────────────────────────────────────────────── */
#promptPreview {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 200px;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #212529;
}

#promptPreview:focus {
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ── Prompt preview panel (wizard sidebar) ─────────────────────────────────── */
#previewPanel {
    position: sticky;
    top: 1rem;
}

/* ── Mode C chat (wizard) ──────────────────────────────────────────────────── */
#wizardChat {
    min-height: 250px;
    max-height: 450px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
}

#wizardChat .chat-msg {
    margin-bottom: 0.75rem;
}

#wizardChat .chat-msg.user {
    text-align: right;
}

#wizardChat .chat-bubble {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 1rem;
    max-width: 85%;
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
}

#wizardChat .chat-msg.assistant .chat-bubble {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top-left-radius: 0.25rem;
}

#wizardChat .chat-msg.user .chat-bubble {
    background: #0d6efd;
    color: #fff;
    border-top-right-radius: 0.25rem;
}

/* ── Library ───────────────────────────────────────────────────────────────── */
.prompt-card {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.prompt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.tag-pill {
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.tag-pill.active {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

/* Param dots (modal) */
.param-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #dee2e6;
}

.param-dot.active {
    background-color: #0d6efd;
}

/* ── Feedback ───────────────────────────────────────────────────────────────── */
.criteria-bar {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #198754, #0d6efd);
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0d6efd, #198754);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* ── Analysis result (wizard step 1) ───────────────────────────────────────── */
#analysisResult {
    animation: fadeIn 0.3s ease;
}

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

/* ── Alerts / flash ─────────────────────────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1060;
    min-width: 280px;
    max-width: 420px;
}

/* ── Responsive tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    #previewPanel {
        position: static;
        margin-top: 1rem;
    }

    #chatArea .card {
        max-width: 95% !important;
    }
}

/* ── Code / pre in modals ───────────────────────────────────────────────────── */
.prompt-preview {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
}

/* ── Process bar — Chevron stepper ──────────────────────────────────────────── */
/*
 * Classic "breadcrumb stepper" using border-trick arrows.
 * Each step is a flex item; the right arrow is a zero-width element with
 * thick left border in the step colour, forming the chevron tip.
 * The left notch is the inverse: a white border that "cuts" into the previous step.
 */

.pbar-wrap {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.pbar-inner {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: none;   /* Firefox */
    height: 44px;
}
.pbar-inner::-webkit-scrollbar { display: none; }

/* ── Individual step ── */
.pbar-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px 0 20px;
    background: var(--pbar-c);
    color: var(--pbar-text);
    text-decoration: none;
    flex-shrink: 0;
    transition: filter .15s;
    /* first step: flat left edge */
}
.pbar-step:first-child { padding-left: 16px; border-radius: 4px 0 0 4px; }
.pbar-step:hover:not(.pbar-future) { filter: brightness(1.1); }

/* ── Left notch (white triangle that "cuts" into previous step) ── */
.pbar-notch-l {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
    border-left: 11px solid white;   /* white = page bg, creates the indent */
}

/* ── Right arrow (coloured triangle pointing right) ── */
.pbar-arrow {
    position: absolute;
    right: -11px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 22px solid transparent;
    border-bottom: 22px solid transparent;
    border-left: 11px solid var(--pbar-c);
    z-index: 1;
}

/* ── Icon circle ── */
.pbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    font-size: .75rem;
    flex-shrink: 0;
}
.pbar-done .pbar-icon { background: rgba(255,255,255,.35); }

/* ── Text block ── */
.pbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.pbar-label {
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.pbar-sub {
    font-size: .62rem;
    opacity: .78;
    white-space: nowrap;
}

/* ── Modus badge inside step 2 ── */
.pbar-badge {
    display: inline-block;
    padding: 0 4px;
    border-radius: 3px;
    font-size: .6rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 2px;
    background: rgba(255,255,255,.35);
}

/* ── Future steps: greyed background ── */
.pbar-future {
    background: #e9ecef !important;
    --pbar-text: #6c757d;
}
.pbar-future .pbar-arrow { border-left-color: #e9ecef; }

/* ── "Überarbeiten" back-link ── */
.pbar-back {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    font-size: .72rem;
    color: #6c757d;
    text-decoration: none;
    border-left: 2px dashed #dee2e6;
    margin-left: 8px;
    flex-shrink: 0;
}
.pbar-back:hover { color: #0d6efd; }

/* ── Process flow (dashboard) ───────────────────────────────────────────────── */
.process-step-dash {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
    text-align: center;
}
.psd-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.process-step-dash:hover .psd-circle,
a.process-step-dash:hover .psd-circle {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.psd-label {
    font-size: .78rem;
    line-height: 1.2;
    font-weight: 600;
}
.psd-sub {
    font-size: .68rem;
    color: #6c757d;
    line-height: 1.2;
}
.psd-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 4px;
    margin-top: -20px; /* align connector with circle center */
}
.psd-line {
    width: 20px;
    height: 2px;
    background: #ced4da;
    border-radius: 1px;
}
.psd-arrow {
    font-size: .7rem;
    color: #6c757d;
    margin-left: -2px;
}
.psd-abc { margin-top: 2px; }
.psd-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 12px;
    gap: 2px;
    padding-top: 4px;
    border-left: 2px dashed #dee2e6;
    padding-left: 10px;
}
.psd-back-label {
    font-size: .67rem;
    color: #6c757d;
    line-height: 1.2;
    text-align: center;
    max-width: 60px;
}

/* ── Scrollbar (subtle) ─────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}
