/**
 * Wizard Styles for Quotation Form
 * 
 * @package AnchorExpressInc\QuotationForm
 * @version 1.0.0
 */

/* ========================================
   Wizard Container
   ======================================== */

.qf-wizard-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.qf-wizard-wrapper {
    background: var(--qf-dynamic-form-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ========================================
   Progress Indicator
   ======================================== */

.qf-wizard-progress {
    background: var(--qf-dynamic-primary);
    padding: 30px 40px;
    position: relative;
}

.qf-wizard-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Connection line between steps */
.qf-wizard-steps::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.qf-wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.qf-wizard-step.qf-step-completed {
    cursor: pointer;
}

.qf-wizard-step.qf-step-completed:hover {
    transform: translateY(-2px);
}

.qf-step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--qf-dynamic-primary);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.qf-wizard-step.qf-step-active .qf-step-circle {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.qf-wizard-step.qf-step-completed .qf-step-circle {
    background: var(--qf-dynamic-success, #10b981);
    border-color: var(--qf-dynamic-success, #10b981);
}

.qf-step-number {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.qf-wizard-step.qf-step-active .qf-step-number {
    color: var(--qf-dynamic-primary, #102d5e);
}

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

.qf-step-check {
    width: 24px;
    height: 24px;
    fill: #ffffff;
    display: none;
}

.qf-wizard-step.qf-step-completed .qf-step-check {
    display: block;
}

.qf-step-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qf-step-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.qf-wizard-step.qf-step-active .qf-step-title,
.qf-wizard-step.qf-step-completed .qf-step-title {
    color: #ffffff;
}

.qf-step-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.qf-wizard-step.qf-step-active .qf-step-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

/* Progress Bar */
.qf-wizard-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.qf-wizard-progress-fill {
    width: 0%;
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.qf-wizard-wrapper.qf-wizard-ready .qf-wizard-progress-fill {
    transition: width 0.4s ease;
}

/* ========================================
   Step Content
   ======================================== */

.qf-wizard-form {
    padding: 40px;
}

.qf-wizard-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.qf-wizard-step-content.qf-step-active {
    display: block;
}

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

.qf-step-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.qf-step-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--qf-dynamic-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qf-step-icon svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

.qf-step-heading {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.qf-step-description {
    font-size: 18px;
    color: var(--qf-gray-700);
    margin: 0;
    line-height: 1.5;
}

.qf-step-fields {
    margin-bottom: 32px;
}

/* ========================================
   Navigation Buttons
   ======================================== */

.qf-wizard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
}

.qf-wizard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 0;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 48px;
}

.qf-wizard-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.qf-wizard-btn-back {
    background: #ffffff;
    color: var(--qf-dynamic-primary);
    border: 2px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.qf-wizard-btn-back:hover {
    background: #f9fafb;
    border-color: var(--qf-dynamic-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: translateX(-2px);
}

.qf-wizard-btn-back:active {
    background: #f3f4f6;
    transform: translateX(-1px);
}

.qf-wizard-btn-next {
    background: var(--qf-dynamic-button);
    color: var(--qf-dynamic-button-secondary);
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qf-wizard-btn-next:hover {
    background: var(--qf-dynamic-button-secondary);
    color: var(--qf-dynamic-button);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateX(2px);
}

.qf-wizard-btn-next:active {
    transform: translateX(1px);
}

.qf-wizard-btn-submit {
    background: var(--qf-dynamic-button) !important;
    color: var(--qf-dynamic-button-secondary) !important;
    margin-left: auto;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qf-wizard-btn-submit:hover:not(:disabled) {
    background: var(--qf-dynamic-button-secondary) !important;
    color: var(--qf-dynamic-button) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.qf-wizard-btn-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.qf-wizard-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Submit button loading state */
.qf-wizard-btn-submit.qf-btn-loading .qf-submit-content {
    opacity: 0;
}

.qf-wizard-btn-submit.qf-btn-loading .qf-submit-loader {
    display: flex;
}

.qf-submit-content {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.qf-submit-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 6px;
}

.qf-submit-loader span {
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.qf-submit-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.qf-submit-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media screen and (max-width: 768px) {
    .qf-wizard-progress {
        padding: 20px;
    }

    .qf-wizard-steps {
        gap: 8px;
    }

    .qf-wizard-steps::before {
        left: 40px;
        right: 40px;
    }

    .qf-step-circle {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }

    .qf-step-number {
        font-size: 16px;
    }

    .qf-step-check {
        width: 20px;
        height: 20px;
    }

    .qf-step-title {
        font-size: 12px;
    }

    .qf-step-subtitle {
        display: none;
    }

    .qf-wizard-form {
        padding: 24px;
    }

    .qf-step-header {
        flex-direction: column;
        gap: 16px;
    }

    .qf-step-icon {
        width: 48px;
        height: 48px;
    }

    .qf-step-icon svg {
        width: 24px;
        height: 24px;
    }

    .qf-step-heading {
        font-size: 24px;
    }

    .qf-step-description {
        font-size: 14px;
    }

    .qf-wizard-navigation {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .qf-wizard-btn {
        width: 100%;
        justify-content: center;
    }

    .qf-wizard-btn-next,
    .qf-wizard-btn-submit {
        margin-left: 0;
    }
}

@media screen and (max-width: 480px) {
    .qf-wizard-container {
        padding: 12px;
    }

    .qf-wizard-progress {
        padding: 16px 12px;
    }

    .qf-wizard-form {
        padding: 20px 16px;
    }

    .qf-step-heading {
        font-size: 20px;
    }

    .qf-wizard-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
}

/* ========================================
   Success State
   ======================================== */

.qf-success-message {
    padding: 40px;
    display: none;
}

.qf-success-message.qf-show {
    display: block;
}

.qf-success-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.qf-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.qf-checkmark {
    width: 80px;
    height: 80px;
    animation: checkmark-pop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmark-pop {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

.qf-checkmark-circle {
    stroke: var(--qf-dynamic-success, #10b981);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.qf-checkmark-check {
    stroke: var(--qf-dynamic-success, #10b981);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.qf-success-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--qf-gray-900);
    margin: 0 0 16px 0;
}

.qf-success-content p {
    font-size: 16px;
    color: var(--qf-gray-700);
    line-height: 1.6;
}

.qf-success-details {
    background: var(--qf-gray-100);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.qf-submission-id {
    font-size: 14px;
    font-weight: 600;
    color: var(--qf-dynamic-primary);
    margin: 0;
}

.qf-success-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.05);
    border: 2px solid var(--qf-dynamic-error-animation);
    border-radius: 8px;
    margin-top: 16px;
}

.qf-success-warning svg {
    width: 24px;
    height: 24px;
    fill: var(--qf-dynamic-error);
    flex-shrink: 0;
    margin-top: 2px;
}

.qf-success-warning p {
    font-size: 14px;
    color: var(--qf-gray-900);
    margin: 0;
    line-height: 1.5;
    text-align: left;
}

.qf-btn-new-request {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--qf-dynamic-button);
    color: var(--qf-dynamic-button-secondary);
    font-size: 16px;
    font-weight: 600;
    border-radius: 0;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qf-btn-new-request:hover {
    background: var(--qf-dynamic-button-secondary);
    color: var(--qf-dynamic-button);
    transform: translateY(-1px);
}
