/* Smart Slide — Wizard Theme */

/* ── Theme Transition ── */
* { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    min-height: 100vh;
}

/* ── Stepper ── */
.stepper { display: flex; align-items: center; justify-content: center; gap: 0; }
.stepper-item {
    display: flex; align-items: center; gap: 0.5rem;
    font-weight: 500; font-size: 0.9rem; opacity: 0.4;
    transition: opacity 0.4s ease; cursor: default;
}
.stepper-item.active { opacity: 1; }
.stepper-item.completed { opacity: 0.7; }
.stepper-circle {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    border: 2px solid var(--bs-secondary-bg);
    background: var(--bs-secondary-bg); color: var(--bs-body-color);
    transition: all 0.4s ease;
}
.stepper-item.active .stepper-circle {
    border-color: var(--bs-success);
    background: var(--bs-success); color: #fff;
    box-shadow: 0 0 0 4px rgba(var(--bs-success-rgb), 0.25);
}
.stepper-item.completed .stepper-circle {
    border-color: var(--bs-success);
    background: var(--bs-success); color: #fff;
}
.stepper-line {
    flex: 1; height: 2px; margin: 0 0.5rem;
    background: var(--bs-secondary-bg);
    position: relative;
    overflow: hidden;
}
.stepper-line .fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%; width: 0;
    background: var(--bs-success);
    transition: width 0.6s ease;
}
.stepper-line.filled .fill { width: 100%; }
.stepper-label { white-space: nowrap; }

/* ── Wizard Panel ── */
.wizard-panel {
    animation: wizardFadeIn 0.35s ease;
}
@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SSE Message Area ── */
.sse-area {
    min-height: 0;
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    transition: min-height 0.3s ease;
}
.sse-area:not(:empty) {
    min-height: 32px;
    margin-bottom: 1rem;
}
.sse-area::-webkit-scrollbar       { width: 5px; }
.sse-area::-webkit-scrollbar-thumb  { background: var(--bs-secondary-bg); border-radius: 3px; }
.sse-message {
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    background: var(--bs-tertiary-bg);
    border-left: 3px solid var(--bs-info);
    animation: sseMessageFadeIn 0.3s ease;
}
.sse-message.sse-success { border-left-color: var(--bs-success); }
.sse-message.sse-danger  { border-left-color: var(--bs-danger); }
.sse-message.sse-warning { border-left-color: var(--bs-warning); }
.sse-message.sse-info    { border-left-color: var(--bs-info); }
.sse-message .text-danger { color: var(--bs-danger) !important; }
.sse-message .text-success { color: var(--bs-success) !important; }

@keyframes sseMessageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Theme Toggle ── */
.theme-toggle {
    position: fixed; top: 1rem; right: 1rem; z-index: 1050;
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg); color: var(--bs-body-color);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}
.theme-toggle:hover { transform: scale(1.1); }

/* ── Progress Bar ── */
.progress {
    height: 26px;
    border-radius: 0.5rem;
    background: var(--bs-secondary-bg);
}
.progress-bar {
    transition: width 0.5s ease;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ── Video Card ── */
.video-card {
    transition: box-shadow 0.2s ease;
}
.video-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.video-name-input {
    font-size: 0.85rem;
}
.video-play-btn {
    width: 32px; height: 32px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

/* ── Spin Animation ── */
.spin {
    display: inline-block;
    animation: spin 2s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Accordion Tweaks ── */
.accordion-button:not(.collapsed) {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
    box-shadow: none;
}
.accordion-button:focus {
    box-shadow: none;
}

/* ── Header Icon ── */
.header-icon {
    font-size: 1.6rem;
    margin-right: 0.6rem;
}

/* ── Prompt Accordion ── */
.prompt-accordion-btn {
    background-color: #dbeeff;
    color: #1a5fa8;
}
.prompt-accordion-btn:not(.collapsed) {
    background-color: #c3dfff;
}
.prompt-accordion-btn:hover {
    background-color: #c3dfff;
}
[data-bs-theme=dark] .prompt-accordion-btn {
    background-color: #1a3a5c;
    color: #90c8f8;
}
[data-bs-theme=dark] .prompt-accordion-btn:not(.collapsed) {
    background-color: #1e4570;
}
[data-bs-theme=dark] .prompt-accordion-btn:hover {
    background-color: #1e4570;
}

/* ── Video Grid ── */
.video-card video {
    object-fit: contain;
    width: 100%;
    height: 100%;
    background: #000;
}

/* ── Form tweaks ── */
.form-check-input:checked {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

/* ── Modal ── */
.question-block {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.question-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── Component Sections (Step 4) ── */
.component-section {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease;
}
.component-section:has(.form-check-input:checked) {
    border-color: var(--bs-success);
}
.component-body {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
    animation: wizardFadeIn 0.25s ease;
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .stepper-circle { width: 30px; height: 30px; font-size: 0.75rem; }
    .stepper-line { margin: 0 0.25rem; }
    .d-flex.gap-2.flex-wrap { flex-direction: column; }
    .d-flex.gap-2.flex-wrap .ms-auto { margin-inline-start: 0 !important; }
}
