/* ==========================================================================
   E-Learning / Schulungen Styles
   Interactive course player with vertical stepper
   ========================================================================== */

/* --------------------------------------------------------------------------
   Public Course Wrapper (standalone page, no app layout)
   -------------------------------------------------------------------------- */

.elearning-public-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    min-height: 100vh;
}

@media (min-width: 600px) {
    .elearning-public-wrapper {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 900px) {
    .elearning-public-wrapper {
        padding: 2.5rem 2rem;
    }
}

/* --------------------------------------------------------------------------
   Course Catalog (index page)
   -------------------------------------------------------------------------- */

.elearning-catalog {
}

.elearning-course-card {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.elearning-course-card:hover {
    border-color: var(--primary-color, #003D83);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.elearning-course-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: color-mix(in srgb, var(--primary-color, #003D83) 10%, white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elearning-course-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary-color, #003D83);
}

.elearning-course-info {
    flex: 1;
    min-width: 0;
}

.elearning-course-info h3 {
    margin: 0 0 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-dark, #1e293b);
}

.elearning-course-info p {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.5;
}

.elearning-course-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted, #64748b);
}

.elearning-course-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.elearning-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.625rem 1.25rem;
    background: var(--primary-color, #003D83);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.elearning-start-btn:hover {
    background: var(--primary-color-dark, #002956);
    color: #fff;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Course Player (show page)
   -------------------------------------------------------------------------- */

.elearning-player {
}

/* --------------------------------------------------------------------------
   Module Navigation Tabs
   -------------------------------------------------------------------------- */

.elearning-module-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
}

.elearning-module-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.elearning-module-tab:hover {
    color: var(--color-text-dark, #1e293b);
}

.elearning-module-tab--active {
    color: var(--primary-color, #003D83);
    border-bottom-color: var(--primary-color, #003D83);
}

.elearning-module-tab--completed {
    color: var(--color-success, #16a34a);
}

.elearning-module-tab__check {
    width: 16px;
    height: 16px;
    color: var(--color-success, #16a34a);
}

.elearning-module-tab__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-border, #e2e8f0);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
}

.elearning-module-tab--active .elearning-module-tab__number {
    background: var(--primary-color, #003D83);
    color: #fff;
}

.elearning-module-tab--completed .elearning-module-tab__number {
    display: none;
}

/* --------------------------------------------------------------------------
   Vertical Stepper
   -------------------------------------------------------------------------- */

.elearning-player h1 {
    word-break: break-word;
    overflow-wrap: break-word;
}

.elearning-stepper {
    margin-bottom: 1.5rem;
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    padding: 1.5rem 1rem;
}

/* Module containers — only show active */
.elearning-module {
    display: none;
}

.elearning-module--active {
    display: block;
}

/* Individual step — flex row: indicator left, content right */
.elearning-step {
    display: flex;
    gap: 1rem;
}

/* Indicator column: number circle + connector line */
.elearning-step__indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.elearning-step__number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-border, #e2e8f0);
    color: var(--color-text-muted, #64748b);
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}

.elearning-step__number-text {
    display: block;
}

.elearning-step__check {
    display: none;
    width: 20px;
    height: 20px;
}

.elearning-step__connector {
    flex: 1;
    width: 2px;
    min-height: 16px;
    background: var(--color-border, #e2e8f0);
    transition: background 0.3s ease;
}

/* Content column: header + expandable body */
.elearning-step__content {
    flex: 1;
    min-width: 0;
    padding-bottom: 1.5rem;
}

.elearning-step__header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.375rem 0;
    background: none;
    border: none;
    cursor: default;
    text-align: left;
}

.elearning-step__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    transition: color 0.3s ease;
}

.elearning-step__body {
    padding-top: 0.75rem;
}

.elearning-step__text {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text, #475569);
}

.elearning-step__demo {
    pointer-events: none;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.25rem;
    overflow: hidden;
    max-width: 100%;
}

/* Prevent demo booking rows from overflowing on narrow screens */
.elearning-step__demo .booking-detail-row,
.elearning-step__demo .detail-row {
    flex-wrap: wrap;
}

.elearning-step__demo .meldung-title,
.elearning-step__demo .booking-title {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* --------------------------------------------------------------------------
   Stepper States
   -------------------------------------------------------------------------- */

/* Active step — primary color indicator, expanded body */
.elearning-step--active .elearning-step__number {
    background: var(--primary-color, #003D83);
    color: #fff;
}

.elearning-step--active .elearning-step__title {
    color: var(--primary-color, #003D83);
}

/* Completed step — green checkmark, collapsed body */
.elearning-step--completed .elearning-step__number {
    background: var(--color-success, #16a34a);
    color: #fff;
}

.elearning-step--completed .elearning-step__number-text {
    display: none;
}

.elearning-step--completed .elearning-step__check {
    display: block;
}

.elearning-step--completed .elearning-step__connector {
    background: var(--color-success, #16a34a);
}

.elearning-step--completed .elearning-step__title {
    color: var(--color-success, #16a34a);
}

.elearning-step--completed .elearning-step__header {
    cursor: pointer;
}

.elearning-step--completed .elearning-step__header:hover .elearning-step__title {
    text-decoration: underline;
}

.elearning-step--completed .elearning-step__content {
    padding-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   Demo Component Styles (for stepper embedded previews)
   -------------------------------------------------------------------------- */

.elearning-demo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.elearning-demo-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.elearning-demo-list__item--nested {
    margin-left: 20px;
}

.elearning-demo-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.elearning-demo-hint {
    margin: 10px 0 0;
    font-size: 0.8125rem;
    font-style: italic;
    color: var(--color-text-muted, #64748b);
}

/* App link below demo cards */
.elearning-step__app-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.875rem;
    color: var(--primary-color, #2563eb);
    text-decoration: none;
}

.elearning-step__app-link:hover {
    text-decoration: underline;
}

.elearning-step__app-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.elearning-demo-list__item--highlight {
    background: color-mix(in srgb, var(--primary-color, #003D83) 8%, white);
    border: 1px solid color-mix(in srgb, var(--primary-color, #003D83) 20%, white);
}

.elearning-demo-list__label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1f2937;
}

/* Bell notification demo */
.elearning-demo-bell {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
}

.elearning-demo-bell__icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border-radius: 50%;
    color: #475569;
}

.elearning-demo-bell__count {
    position: absolute;
    top: -2px;
    right: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
}

.elearning-demo-bell__label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-dark, #1e293b);
}

/* Assignment resolution chain (Step 2 demo) */
.elearning-demo-chain {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.elearning-demo-chain__task {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.elearning-demo-chain__task + .elearning-demo-chain__task {
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.elearning-demo-chain__task-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.elearning-demo-chain__arrow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    font-size: 0.85rem;
    color: #6b7280;
}

.elearning-demo-chain__arrow::before {
    content: '\2192';
    color: var(--primary-color, #003D83);
    font-weight: 600;
}

/* Section title within demo areas */
.elearning-demo-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin: 16px 0 8px;
}

.elearning-demo-section-title:first-child {
    margin-top: 0;
}

/* Button wrapper for demo action buttons */
.elearning-demo-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.elearning-demo-actions .btn-secondary,
.elearning-demo-actions .btn-primary {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Meldung button in demo */
.elearning-demo-meldung-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Booking tasks list inside demo */
.elearning-step__demo .booking-tasks-list {
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Survey Results Demo (Module 3 Step 3) — scoped overrides for e-learning
   -------------------------------------------------------------------------- */

.elearning-step__demo .survey-result-card {
    padding: var(--spacing-md) var(--spacing-lg);
}

.elearning-step__demo .survey-result-question {
    margin-bottom: var(--spacing-sm);
}

.elearning-step__demo .result-bar {
    height: 16px;
}

.elearning-step__demo .participation-progress {
    margin: 0 var(--spacing-sm);
}

/* --------------------------------------------------------------------------
   Birthday Calendar Demo (Module 3 Step 4) — scoped overrides for e-learning
   -------------------------------------------------------------------------- */

.elearning-step__demo .birthday-calendar {
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: none;
    border: 1px solid var(--border-gray);
    border-radius: var(--border-radius-lg);
}

.elearning-step__demo .calendar-nav {
    margin-bottom: var(--spacing-sm);
}

.elearning-step__demo .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
}

.elearning-step__demo .calendar-day {
    min-height: 48px;
    padding: 4px 6px;
}

.elearning-step__demo .calendar-birthday-name {
    font-size: 0.65rem;
    padding: 1px 4px;
}

@media (max-width: 599px) {
    .elearning-step__demo .calendar-day {
        min-height: 36px;
        padding: 2px 3px;
    }

    .elearning-step__demo .calendar-birthday-name {
        font-size: 0.6rem;
    }

    .elearning-step__demo .calendar-day-number {
        font-size: 0.7rem;
    }
}

/* --------------------------------------------------------------------------
   Profile Demo (Module 3 Step 1) — Identity card subset from Focus View
   Scoped under .elearning-step__demo to avoid conflicts with real Focus View.
   -------------------------------------------------------------------------- */

.elearning-step__demo .employee-focus-identity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.elearning-step__demo .employee-focus-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color, #003D83), var(--primary-color-dark, #002956));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
}

.elearning-step__demo .employee-focus-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.elearning-step__demo .employee-focus-photo-initials {
    font-size: 36px;
    color: white;
    font-weight: 600;
}

.elearning-step__demo .employee-focus-name {
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
    margin: 0 0 8px 0;
}

.elearning-step__demo .employee-focus-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

.elearning-step__demo .employee-contact-section {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    min-width: 0;
    overflow: hidden;
}

@media (min-width: 600px) {
    .elearning-step__demo .employee-focus-grid {
        grid-template-columns: 1fr 1fr;
    }

    .elearning-step__demo .employee-focus-identity-card {
        grid-column: 1 / -1;
    }
}

/* --------------------------------------------------------------------------
   Step Controls (Back / Progress / Next)
   -------------------------------------------------------------------------- */

.elearning-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem;
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
}

.elearning-controls__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    background: var(--color-background, #fff);
    color: var(--color-text, #475569);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.elearning-controls__btn:hover {
    background: color-mix(in srgb, var(--primary-color, #003D83) 10%, white);
    border-color: var(--primary-color, #003D83);
    color: var(--primary-color, #003D83);
}

.elearning-controls__btn--primary {
    background: var(--primary-color, #003D83);
    border-color: var(--primary-color, #003D83);
    color: #fff;
}

.elearning-controls__btn--primary:hover {
    background: var(--primary-color-dark, #002956);
    border-color: var(--primary-color-dark, #002956);
    color: #fff;
}

.elearning-controls__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.elearning-controls__btn:disabled:hover {
    background: var(--color-background, #fff);
    border-color: var(--color-border, #e2e8f0);
    color: var(--color-text, #475569);
}

.elearning-controls__progress {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    min-width: 120px;
}

.elearning-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-border, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
}

.elearning-progress-bar__fill {
    height: 100%;
    background: var(--primary-color, #003D83);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.elearning-progress-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #64748b);
}

/* --------------------------------------------------------------------------
   Completion Screen
   -------------------------------------------------------------------------- */

.elearning-completion {
    display: none;
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--color-background, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
}

.elearning-completion--visible {
    display: block;
}

.elearning-completion__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: var(--color-success-light, #f0fdf4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.elearning-completion__icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-success, #16a34a);
}

.elearning-completion h2 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark, #1e293b);
}

.elearning-completion p {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    color: var(--color-text-muted, #64748b);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* --------------------------------------------------------------------------
   Reduce Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .elearning-step__number,
    .elearning-step__connector,
    .elearning-step__title,
    .elearning-progress-bar__fill {
        transition: none;
    }
}

[data-reduce-motion="reduce"] .elearning-step__number,
[data-reduce-motion="reduce"] .elearning-step__connector,
[data-reduce-motion="reduce"] .elearning-step__title,
[data-reduce-motion="reduce"] .elearning-progress-bar__fill {
    transition: none;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints (mobile-first)
   -------------------------------------------------------------------------- */

/* 600px+ — Tablet */
@media (min-width: 600px) {
    .elearning-stepper {
        padding: 1.5rem;
    }

    .elearning-module-nav {
        padding: 0.5rem 1.5rem;
    }

    .elearning-module-tab {
        font-size: 0.9375rem;
        padding: 0.75rem 1.25rem;
    }

    .elearning-step {
        gap: 1.25rem;
    }

    .elearning-step__number {
        width: 40px;
        height: 40px;
        font-size: 0.9375rem;
    }

    .elearning-step__title {
        font-size: 1.0625rem;
    }
}

/* 900px+ — Desktop */
@media (min-width: 900px) {
    .elearning-stepper {
        padding: 2rem;
    }

    .elearning-step__title {
        font-size: 1.125rem;
    }

    .elearning-step__text {
        font-size: 1rem;
    }
}

/* 1500px+ — Presentation-friendly */
@media (min-width: 1500px) {
    .elearning-step__number {
        width: 48px;
        height: 48px;
        font-size: 1.0625rem;
    }

    .elearning-step__check {
        width: 24px;
        height: 24px;
    }

    .elearning-step__title {
        font-size: 1.25rem;
    }

    .elearning-step__text {
        font-size: 1.125rem;
    }

    .elearning-module-tab {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}
