/* =============================================
   SkillForge — Slash Commands Builder Wizard
   ============================================= */

/* ── Base (standalone — not dependent on claudemd.css or subrules.css) ── */
.sf-wizard {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sf-step {
    display: none;
}

.sf-step.active {
    display: block;
    animation: sfFadeIn 0.3s ease;
}

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

.sf-step-inner {
    background: #ffffff;
    border: 1.5px solid #e5e0f5;
    border-radius: 20px;
    padding: 2.5rem 2.5rem 2rem;
}

.sf-intro-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.sf-question {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1523;
    margin: 0 0 0.6rem;
    line-height: 1.3;
}

.sf-hint {
    font-size: 1.05rem;
    color: #6b7280;
    margin: 0 0 1rem;
    line-height: 1.6;
}

.sf-hint code,
.sf-step-inner code {
    background: #ede9fe;
    color: #5b21b6;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

.sf-form-label-sm {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 4px;
}

.sf-input {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.9rem 1.1rem;
    border: 2px solid #e5e0f5;
    border-radius: 12px;
    color: #1a1523;
    background: #faf9fc;
    margin-bottom: 1.2rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.sf-input:focus {
    border-color: #7c3aed;
    background: #fff;
}

.sf-textarea {
    width: 100%;
    font-size: 1.05rem;
    padding: 0.9rem 1.1rem;
    border: 2px solid #e5e0f5;
    border-radius: 12px;
    color: #1a1523;
    background: #faf9fc;
    margin-bottom: 1.2rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
    font-family: inherit;
}

.sf-textarea:focus {
    border-color: #7c3aed;
    background: #fff;
}

.sf-step-indicator {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    margin-bottom: 0.6rem;
}

.sf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, border-color 0.15s, color 0.15s;
    font-family: inherit;
    text-decoration: none;
    border: 2px solid transparent;
}

.sf-btn:active {
    transform: translateY(0);
}

.sf-btn-primary {
    color: #ffffff;
    background: #7c3aed;
    border-color: #7c3aed;
}

.sf-btn-primary:hover {
    background: #6d28d9;
    border-color: #6d28d9;
    transform: translateY(-1px);
}

.sf-btn-secondary {
    color: #6b7280;
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.sf-btn-secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

.sf-btn-ghost {
    background: none;
    border-color: #7c3aed;
    color: #7c3aed;
    text-decoration: none;
}

.sf-btn-ghost:hover {
    background: #f3eeff;
}

.sf-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 1.5rem;
}

.sf-nav .sf-btn {
    flex: 1;
}

.sf-optional {
    font-weight: 400;
    font-size: 15px;
    color: #888;
}

/* ── Output ── */
.sf-output-inner {
    padding-bottom: 2.5rem;
}

.sf-output-header {
    margin-bottom: 1.5rem;
}

.sf-output-box {
    background: #faf9fc;
    border: 2px solid #e5e0f5;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.sf-output-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    background: #f0ecfd;
    border-bottom: 1.5px solid #e5e0f5;
}

.sf-output-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #5b21b6;
    font-family: 'Space Mono', 'Courier New', monospace;
}

.sf-copy-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7c3aed;
    background: #ffffff;
    border: 1.5px solid #c4b5fd;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.sf-copy-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}

.sf-output-text {
    font-size: 0.92rem;
    line-height: 1.8;
    color: #1a1523;
    padding: 1.5rem;
    white-space: pre-wrap;
    font-family: 'Space Mono', 'Courier New', monospace;
    max-height: 420px;
    overflow-y: auto;
    margin: 0;
}

.sf-output-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.sf-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: #7c3aed;
    border: none;
    border-radius: 12px;
    padding: 0.85rem 1.4rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.sf-btn-download:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.sf-btn-download:active {
    transform: translateY(0);
}

.sf-btn-restart {
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
    font-family: inherit;
    padding: 0.5rem 0;
}

.sf-btn-restart:hover {
    color: #6b7280;
}

/* ── Shared reuse from subrules ── */
.sr-file-path {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 15px;
    background: #f3eeff;
    color: #7c3aed;
    padding: 6px 14px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 6px;
}

.sr-next-steps {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid #eee;
    text-align: center;
}

.sr-next-steps p {
    margin-bottom: 16px;
    font-size: 16px;
    color: #555;
}

.sr-next-steps p code {
    background: #ede9fe;
    color: #5b21b6;
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

.sr-next-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sr-rule-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.sr-rule-row .sf-input {
    margin-bottom: 0;
    flex: 1;
}

.sr-remove-rule {
    background: none;
    border: 2px solid #e5e0f5;
    border-radius: 8px;
    color: #aaa;
    font-size: 15px;
    cursor: pointer;
    padding: 8px 10px;
    transition: all 0.2s;
    font-family: inherit;
    flex-shrink: 0;
    line-height: 1;
}

.sr-remove-rule:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fff5f5;
}

/* ── Slash commands specific ── */
.sc-examples-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.sc-example-btn {
    padding: 8px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    font-family: 'Space Mono', 'Courier New', monospace;
    transition: all 0.2s ease;
    color: #333;
}

.sc-example-btn::before {
    content: '/';
    color: #7c3aed;
    font-weight: bold;
}

.sc-example-btn:hover {
    border-color: #7c3aed;
    background: #f9f5ff;
}

.sc-example-btn.selected {
    border-color: #7c3aed;
    background: #f3eeff;
    color: #7c3aed;
    font-weight: 600;
}

.sc-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0;
}

.sc-slash-prefix {
    font-size: 28px;
    font-weight: bold;
    color: #7c3aed;
    line-height: 1;
    flex-shrink: 0;
}

.sc-name-row .sf-input {
    margin-bottom: 0;
    max-width: 320px;
    font-family: 'Space Mono', 'Courier New', monospace;
}

.sc-toggle-row {
    margin: 16px 0;
}

.sc-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    cursor: pointer;
    font-weight: 500;
    color: #1a1523;
}

.sc-toggle-label input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#sc-args-area,
#sc-context-area {
    margin-top: 16px;
}

.sc-add-btn {
    margin-top: 10px;
    margin-bottom: 8px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .sf-step-inner {
        padding: 1.8rem 1.4rem 1.5rem;
    }

    .sf-question {
        font-size: 1.35rem;
    }

    .sc-examples-row {
        gap: 8px;
    }

    .sc-name-row .sf-input {
        max-width: 100%;
    }

    .sf-nav {
        flex-direction: column-reverse;
    }

    .sf-output-actions {
        flex-direction: column;
    }

    .sf-btn-download {
        justify-content: center;
    }

    .sr-next-links {
        flex-direction: column;
    }
}
