/**
 * Multi-Step Wizard Component
 * Provides a clean, intuitive multi-step form experience
 * with progress bar, navigation, and responsive design
 */

/* =====================================================
   WIZARD CONTAINER
   ===================================================== */

.wizard-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* =====================================================
   PROGRESS BAR
   ===================================================== */

.wizard-progress {
    position: relative;
    z-index: 10;
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.wizard-progress-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 1rem;
}

/* Progress line connecting steps */
.wizard-progress-line {
    position: absolute;
    top: 24px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.wizard-progress-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Individual step */
.wizard-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    cursor: pointer;
    flex: 1;
    max-width: 120px;
    transition: all 0.3s ease;
}

.wizard-step-indicator:hover .wizard-step-circle {
    transform: scale(1.1);
}

.wizard-step-indicator.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.wizard-step-indicator.disabled:hover .wizard-step-circle {
    transform: scale(1);
}

.wizard-step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wizard-step-indicator.completed .wizard-step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.wizard-step-indicator.active .wizard-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(193, 26, 26, 0.2);
    transform: scale(1.1);
}

.wizard-step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.wizard-step-indicator.active .wizard-step-label {
    color: var(--primary);
}

.wizard-step-indicator.completed .wizard-step-label {
    color: var(--text-primary);
}

/* =====================================================
   WIZARD STEPS CONTENT
   ===================================================== */

.wizard-steps {
    position: relative;
    min-height: 400px;
}

.wizard-step {
    display: none;
    animation: fadeInStep 0.4s ease-out;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step content card */
.wizard-step-content {
    background: var(--card-background);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wizard-step-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.wizard-step-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wizard-step-title i {
    color: var(--primary);
    font-size: 1.5rem;
}

.wizard-step-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.wizard-step-body {
    margin-bottom: 2rem;
}

/* =====================================================
   WIZARD NAVIGATION
   ===================================================== */

.wizard-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.wizard-nav-left,
.wizard-nav-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.wizard-nav-left {
    flex: 1;
}

.wizard-nav-right {
    flex: 1;
    justify-content: flex-end;
}

/* Navigation buttons */
.wizard-btn {
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-btn-back {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.wizard-btn-back:hover:not(:disabled) {
    background: var(--hover-background);
    border-color: var(--text-primary);
}

.wizard-btn-next {
    background: var(--primary);
    color: white;
}

.wizard-btn-next:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(193, 26, 26, 0.3);
}

.wizard-btn-draft {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.wizard-btn-draft:hover:not(:disabled) {
    background: var(--hover-background);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.wizard-btn-update {
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
}

.wizard-btn-update:hover:not(:disabled) {
    background: #a51616;
    border-color: #a51616;
    color: white;
}

/* Draft saved indicator */
.wizard-draft-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wizard-draft-indicator.show {
    opacity: 1;
}

.wizard-draft-indicator i {
    animation: checkPulse 0.6s ease-out;
}

@keyframes checkPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* =====================================================
   VALIDATION MESSAGES
   ===================================================== */

.wizard-validation-summary {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: none;
}

.wizard-validation-summary.show {
    display: block;
    animation: shake 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.wizard-validation-summary h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-validation-list {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--error);
    font-size: 0.875rem;
}

.wizard-validation-list li {
    margin-bottom: 0.25rem;
}

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .wizard-progress {
        top: 60px;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .wizard-progress-track {
        padding: 0 0.5rem;
    }

    .wizard-step-indicator {
        max-width: 60px;
    }

    .wizard-step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .wizard-step-label {
        font-size: 0.65rem;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wizard-step-content {
        padding: 1.5rem 1rem;
    }

    .wizard-step-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    .wizard-step-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .wizard-step-description {
        font-size: 0.9rem;
    }

    .wizard-navigation {
        flex-direction: column-reverse;
        gap: 0.75rem;
        padding-top: 1.5rem;
    }

    .wizard-nav-left,
    .wizard-nav-right {
        width: 100%;
        flex-direction: column;
    }

    .wizard-nav-right {
        align-items: stretch;
    }

    .wizard-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .wizard-step-indicator {
        max-width: 50px;
    }

    .wizard-step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Show only numbers on very small screens */
    .wizard-step-label {
        display: none;
    }

    .wizard-step-indicator.active .wizard-step-label {
        display: block;
        position: absolute;
        top: 100%;
        margin-top: 0.75rem;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        background: var(--card-background);
        padding: 0.25rem 0.5rem;
        border-radius: var(--radius-sm);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        z-index: 10;
    }
}

/* =====================================================
   DARK THEME SUPPORT
   ===================================================== */

[data-theme="dark"] .wizard-progress {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .wizard-step-content {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .wizard-step-circle {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .wizard-validation-summary {
    background: rgba(239, 68, 68, 0.15);
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
    .wizard-progress {
        position: static;
    }

    .wizard-navigation {
        display: none;
    }

    .wizard-step {
        display: block !important;
        page-break-after: always;
    }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */

.wizard-step-indicator:focus {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.wizard-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wizard-step,
    .wizard-step-circle,
    .wizard-progress-line-fill,
    .wizard-btn {
        animation: none;
        transition: none;
    }
}
