/* ========================
   Wizard Multi-Step Form
   ======================== */

/* Wizard container */
.wizard-container {
    max-width: 900px;
    margin: 0 auto;
}

/* ========================
   Progress Indicator
   ======================== */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 1rem;
    counter-reset: step;
}

.wizard-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    text-align: center;
}

/* Connector line between steps */
.wizard-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--bs-border-color, #dee2e6);
    z-index: 0;
}

.wizard-progress-step.completed:not(:last-child)::after {
    background-color: var(--bs-success, #198754);
}

/* Step circle */
.wizard-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-secondary-color, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    border: 2px solid var(--bs-border-color, #dee2e6);
    transition: all 0.3s ease;
}

.wizard-progress-step.active .wizard-step-number {
    background-color: var(--bs-primary, #0d6efd);
    color: #fff;
    border-color: var(--bs-primary, #0d6efd);
}

.wizard-progress-step.completed .wizard-step-number {
    background-color: var(--bs-success, #198754);
    color: #fff;
    border-color: var(--bs-success, #198754);
}

/* Checkmark for completed steps */
.wizard-progress-step.completed .wizard-step-number::after {
    content: '\2713';
    font-size: 1rem;
}

.wizard-progress-step.completed .wizard-step-number span {
    display: none;
}

/* Step label */
.wizard-step-label {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wizard-progress-step.active .wizard-step-label {
    color: var(--bs-primary, #0d6efd);
    font-weight: 600;
}

.wizard-progress-step.completed .wizard-step-label {
    color: var(--bs-success, #198754);
}

/* Optional/skipped step indicator */
.wizard-progress-step.optional .wizard-step-number::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background-color: var(--bs-warning, #ffc107);
    border-radius: 50%;
    border: 1px solid var(--bs-body-bg, #fff);
}

.wizard-progress-step.skipped .wizard-step-number {
    background-color: var(--bs-secondary-bg, #e9ecef);
    color: var(--bs-secondary-color, #6c757d);
    border-color: var(--bs-secondary, #6c757d);
    border-style: dashed;
    opacity: 0.6;
}

.wizard-progress-step.skipped .wizard-step-label {
    color: var(--bs-secondary-color, #6c757d);
    text-decoration: line-through;
    opacity: 0.6;
}

.wizard-progress-step.skipped:not(:last-child)::after {
    border-style: dashed;
    opacity: 0.5;
}

/* ========================
   Step Content
   ======================== */
.wizard-step {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Step header */
.wizard-step-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.wizard-step-header h2 {
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.wizard-step-header p {
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0;
}

/* ========================
   Navigation Buttons
   ======================== */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

.wizard-nav-left,
.wizard-nav-right {
    display: flex;
    gap: 0.5rem;
}

/* Make navigation buttons more prominent */
#wizard-next,
#wizard-submit {
    min-width: 140px;
}

#wizard-prev {
    min-width: 100px;
}

/* Add Another Student button */
#wizard-add-student {
    min-width: 180px;
}

/* Skip to Review button */
#wizard-skip-review {
    min-width: 140px;
}

/* Remove Student button */
#wizard-remove-student {
    min-width: 180px;
}

/* ========================
   Review Step
   ======================== */
.wizard-review-section {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.wizard-review-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wizard-review-section .edit-btn {
    font-size: 0.75rem;
}

.wizard-review-row {
    display: flex;
    margin-bottom: 0.5rem;
}

.wizard-review-label {
    font-weight: 600;
    min-width: 140px;
    flex-shrink: 0;
    color: var(--bs-secondary-color, #6c757d);
}

.wizard-review-value {
    flex: 1;
}

/* File indicator in review */
.wizard-file-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--bs-success, #198754);
    font-size: 0.875rem;
}

.wizard-file-indicator.missing {
    color: var(--bs-danger, #dc3545);
}

/* Piece review cards */
.wizard-piece-review {
    background-color: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.wizard-piece-review h5 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--bs-primary, #0d6efd);
}

/* ========================
   Mobile Responsive
   ======================== */
@media (max-width: 576px) {
    .wizard-progress {
        padding: 0;
    }

    /* Hide step labels on mobile, show only numbers */
    .wizard-step-label {
        display: none;
    }

    .wizard-step-number {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .wizard-progress-step:not(:last-child)::after {
        top: 15px;
    }

    .wizard-nav {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .wizard-nav-left,
    .wizard-nav-right {
        width: 100%;
    }

    #wizard-next,
    #wizard-submit,
    #wizard-prev,
    #wizard-add-student,
    #wizard-skip-review,
    #wizard-remove-student {
        width: 100%;
    }

    .wizard-review-row {
        flex-direction: column;
    }

    .wizard-review-label {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
}

/* ========================
   Dark Mode Adjustments
   ======================== */
[data-bs-theme="dark"] .wizard-review-section {
    background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .wizard-piece-review {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .wizard-progress-step.optional .wizard-step-number::before {
    border-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .wizard-progress-step.skipped .wizard-step-number {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-secondary);
}

/* ========================
   Validation States
   ======================== */
.wizard-step .is-invalid {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Step validation error summary */
.wizard-step-errors {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
    border: 1px solid var(--bs-danger);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.wizard-step-errors ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.wizard-step-errors li {
    color: var(--bs-danger);
}

/* ========================
   Accessibility
   ======================== */
.wizard-progress-step:focus-visible .wizard-step-number {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Screen reader only text */
.wizard-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
