/**
 * Styles du Wizard
 *
 * @package SlideMind
 * @since 2.0.0
 */

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.sm-wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.sm-wizard-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--sm-gray-200);
    z-index: 0;
}

.sm-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sm-wizard-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sm-gray-100);
    border: 2px solid var(--sm-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--sm-gray-500);
    transition: all 0.3s ease;
}

.sm-wizard-step-label {
    margin-top: 8px;
    font-size: 13px;
    color: var(--sm-gray-500);
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Active step */
.sm-wizard-step.active .sm-wizard-step-number {
    background: var(--sm-primary);
    border-color: var(--sm-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.sm-wizard-step.active .sm-wizard-step-label {
    color: var(--sm-primary);
}

/* Completed step */
.sm-wizard-step.completed .sm-wizard-step-number {
    background: var(--sm-success);
    border-color: var(--sm-success);
    color: white;
}

.sm-wizard-step.completed .sm-wizard-step-number::after {
    content: '✓';
    font-size: 18px;
}

.sm-wizard-step.completed .sm-wizard-step-label {
    color: var(--sm-success);
}

/* Skipped step (capture mode) */
.sm-wizard-step.skipped {
    pointer-events: none;
    opacity: 0.5;
}

.sm-wizard-step.skipped .sm-wizard-step-number {
    background: var(--sm-gray-200);
    border-color: var(--sm-gray-300);
    color: transparent;
}

.sm-wizard-step.skipped .sm-wizard-step-number::after {
    content: '\2014';
    font-size: 16px;
    color: var(--sm-gray-400);
}

.sm-wizard-step.skipped .sm-wizard-step-label {
    color: var(--sm-gray-400);
    text-decoration: line-through;
}

/* Capture variable rows (wizard) */
.wizard-capture-var-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

/* Output variable rows (wizard) */
.wizard-output-var-row {
    margin-bottom: 8px;
}

.wizard-output-var-row-top {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wizard-output-var-desc {
    margin-top: 4px;
    width: 100%;
}

/* Auto-save suboptions */
#wizard-autosave-suboptions {
    padding: 12px 0 0 24px;
    border-left: 2px solid var(--sm-gray-200);
    margin: 8px 0 0 8px;
}

#wizard-autosave-suboptions label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* ==========================================================================
   Panels
   ========================================================================== */

.sm-wizard-panel {
    display: none;
    animation: wizardFadeIn 0.3s ease;
}

.sm-wizard-panel.active {
    display: block;
}

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

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

.sm-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--sm-gray-200);
}

.sm-wizard-nav-spacer {
    flex: 1;
}

/* ==========================================================================
   Template Cards
   ========================================================================== */

.sm-template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sm-template-card {
    cursor: pointer;
}

.sm-template-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sm-template-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    border: 2px solid var(--sm-gray-200);
    border-radius: 8px;
    transition: all 0.2s ease;
    background: white;
}

.sm-template-card-content:hover {
    border-color: var(--sm-gray-300);
    background: var(--sm-gray-50);
}

.sm-template-card input:checked + .sm-template-card-content {
    border-color: var(--sm-primary);
    background: var(--sm-primary-light);
}

.sm-template-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.sm-template-card-content strong {
    font-size: 14px;
    margin-bottom: 4px;
}

.sm-template-card-content p {
    font-size: 12px;
    color: var(--sm-gray-500);
    margin: 0;
}

/* Wizard pill variant (compact horizontal strip) */
.sm-template-cards--wizard {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.sm-template-cards--wizard .sm-template-card-content {
    flex-direction: row;
    padding: 8px 14px;
    border-radius: 20px;
    gap: 6px;
    text-align: left;
}

.sm-template-cards--wizard .sm-template-icon {
    font-size: 18px;
    margin-bottom: 0;
}

.sm-template-cards--wizard .sm-template-card-content strong {
    font-size: 13px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sm-template-cards--wizard .sm-template-card-content p {
    display: none;
}

.sm-template-cards--wizard .sm-template-card-dropdown .sm-template-card-content {
    border-style: dashed;
}

/* Wizard section divider */
.sm-wizard-divider {
    margin: 28px 0;
    border: none;
    border-top: 1px solid var(--sm-gray-200);
}

/* Variable tags bar (above prompt in step 4) */
.sm-variable-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--sm-gray-50, #f9fafb);
    border: 1px solid var(--sm-gray-200, #e5e7eb);
    border-radius: 6px;
    font-size: 12px;
}

.sm-variable-tags-label {
    font-weight: 600;
    color: var(--sm-gray-500, #6b7280);
    margin-right: 4px;
}

.sm-variable-tags .sm-tag-system {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.sm-variable-tags .sm-tag-custom {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Dropdown variant for "Autres templates" */
.sm-template-more {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sm-template-card-dropdown .sm-template-card-content {
    border-style: dashed;
}

.sm-template-dropdown-select {
    font-size: 13px;
    padding: 8px 12px;
    border: 1px solid var(--sm-gray-200);
    border-radius: 6px;
    background: white;
    width: 100%;
}

/* ==========================================================================
   Model Pricing
   ========================================================================== */

.sm-model-pricing {
    margin-top: 12px;
}

/* ==========================================================================
   Collapsible (wizard-specific)
   ========================================================================== */

.sm-form-collapsible {
    margin-top: 20px;
}

/* ==========================================================================
   Range Slider
   ========================================================================== */

.sm-form-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--sm-gray-200);
    border-radius: 3px;
    outline: none;
}

.sm-form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--sm-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sm-form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--sm-primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sm-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--sm-gray-500);
}

.sm-range-labels span:nth-child(2) {
    font-weight: 600;
    color: var(--sm-primary);
}

/* ==========================================================================
   Variables
   ========================================================================== */

.sm-variables-section h4 {
    font-size: 14px;
    margin: 0 0 12px 0;
    color: var(--sm-gray-700);
}

.sm-variables-list {
    background: var(--sm-gray-50);
    border-radius: 6px;
    padding: 12px;
}

.sm-variable-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--sm-gray-200);
}

.sm-variable-row:last-child {
    border-bottom: none;
}

.sm-variable-row code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    min-width: 180px;
}

.sm-variable-row.sm-variable-system code {
    background: var(--sm-primary-light);
    color: var(--sm-primary);
}

.sm-variable-desc {
    color: var(--sm-gray-500);
    font-size: 13px;
}

.sm-variable-row input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--sm-gray-300);
    border-radius: 4px;
    font-size: 13px;
}

.sm-variable-row .sm-btn-danger {
    padding: 4px 8px;
}

.sm-empty-variables {
    color: var(--sm-gray-500);
    font-size: 13px;
    margin: 0;
    padding: 8px 0;
}

/* ==========================================================================
   Summary
   ========================================================================== */

.sm-summary-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--sm-gray-100);
}

.sm-summary-row:last-child {
    border-bottom: none;
}

.sm-summary-label {
    font-weight: 500;
    color: var(--sm-gray-600);
    width: 100px;
}

.sm-summary-value {
    color: var(--sm-gray-800);
}

/* ==========================================================================
   Test Area
   ========================================================================== */

.sm-test-variables {
    margin-bottom: 16px;
}

.sm-test-variables .sm-form-group {
    margin-bottom: 12px;
}

.sm-test-variables label {
    font-size: 13px;
}

.sm-test-result {
    margin-top: 16px;
    padding: 16px;
    background: var(--sm-gray-50);
    border-radius: 6px;
}

.sm-test-result h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
}

.sm-test-response {
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--sm-gray-200);
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-size: 13px;
}

.sm-test-debug {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--sm-gray-500);
}

.sm-test-debug strong {
    color: var(--sm-gray-700);
}

/* ==========================================================================
   Inherited Preview
   ========================================================================== */

.sm-inherited-preview {
    background: var(--sm-gray-50);
    border-radius: 6px;
    padding: 16px;
    margin-top: 20px;
}

.sm-inherited-preview h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--sm-gray-700);
}

.sm-inherited-field {
    font-size: 13px;
    padding: 4px 0;
}

.sm-inherited-field strong {
    color: var(--sm-gray-600);
}

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

@media (max-width: 782px) {
    .sm-wizard-progress {
        flex-wrap: wrap;
        gap: 16px;
    }

    .sm-wizard-progress::before {
        display: none;
    }

    .sm-wizard-step {
        flex: 0 0 calc(33.333% - 12px);
    }

    .sm-wizard-step-label {
        font-size: 11px;
    }

    .sm-template-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .sm-wizard-panel .sm-form-row {
        flex-direction: column;
    }
}
