/* TableCrafter — Table Creation Wizard CSS (#1977) */
:root {
    --wz-tc:     #0d9488;
    --wz-dark:   #0f766e;
    --wz-light:  #f0fdfa;
    --wz-border: #99f6e4;
    --wz-radius: 8px;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.gt-wizard-wrap .gt-wizard-page-h1 { display: none; }
.gt-wizard-wrap { max-width: 820px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.gt-wizard-hero {
    background: linear-gradient(135deg, var(--wz-tc) 0%, var(--wz-dark) 100%);
    border-radius: var(--wz-radius);
    padding: 22px 28px;
    margin: 16px 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(13,148,136,.25);
    color: #fff;
}
.gt-wizard-hero-icon {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: rgba(255,255,255,.85);
    flex-shrink: 0;
}
.gt-wizard-hero h2 {
    margin: 0 0 4px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    border: none;
}
.gt-wizard-hero p { margin: 0; color: rgba(255,255,255,.85); font-size: 13px; }
.gt-wizard-beta-badge {
    margin-left: auto;
    flex-shrink: 0;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ── Step Indicator ──────────────────────────────────────────────────────── */
.gt-wizard-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}
.gt-wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.gt-wizard-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}
.gt-wizard-step-label {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
    transition: color .2s ease;
}
.gt-wizard-step--active .gt-wizard-step-num {
    background: var(--wz-tc);
    color: #fff;
}
.gt-wizard-step--active .gt-wizard-step-label { color: var(--wz-tc); font-weight: 600; }
.gt-wizard-step--done .gt-wizard-step-num {
    background: var(--wz-dark);
    color: #fff;
}
.gt-wizard-step--done .gt-wizard-step-num::before { content: '✓'; }
.gt-wizard-step--done .gt-wizard-step-num { font-size: 0; }
.gt-wizard-step--done .gt-wizard-step-num::before { font-size: 12px; }
.gt-wizard-step--done .gt-wizard-step-label { color: var(--wz-dark); }
.gt-wizard-step-connector {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 8px;
    border-radius: 2px;
    transition: background .2s ease;
}
.gt-wizard-step-connector--done { background: var(--wz-dark); }

/* ── Panels ──────────────────────────────────────────────────────────────── */
.gt-wizard-panels {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--wz-radius);
    padding: 28px 32px;
    min-height: 340px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.gt-wizard-panel { display: none; }
.gt-wizard-panel--active { display: block; }

/* ── Step inner ──────────────────────────────────────────────────────────── */
.gt-wizard-step-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
}
.gt-wizard-step-icon {
    color: var(--wz-tc);
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.gt-wizard-step-desc {
    color: #6b7280;
    font-size: 13px;
    margin: 0 0 22px;
    line-height: 1.6;
}

/* ── Source card grid (Step 1) ───────────────────────────────────────────── */
.gt-wizard-source-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.gt-wizard-source-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 18px 18px 14px;
    border: 2px solid #e5e7eb;
    border-radius: var(--wz-radius);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    position: relative;
    text-decoration: none;
    color: inherit;
}
.gt-wizard-source-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.gt-wizard-source-card:hover {
    border-color: var(--wz-border);
    box-shadow: 0 2px 8px rgba(13,148,136,.10);
    background: var(--wz-light);
}
.gt-wizard-source-card--selected {
    border-color: var(--wz-tc) !important;
    background: var(--wz-light) !important;
    box-shadow: 0 2px 8px rgba(13,148,136,.18) !important;
}
.gt-wizard-source-card--selected::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--wz-tc);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}
.gt-wizard-source-card--unavailable {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}
.gt-wizard-source-card--advanced {
    background: #fafafa;
    border-style: dashed;
}
.gt-wizard-source-icon {
    font-size: 26px;
    width: 26px;
    height: 26px;
    color: var(--wz-tc);
    margin-bottom: 6px;
}
.gt-wizard-source-card--advanced .gt-wizard-source-icon { color: #9ca3af; }
.gt-wizard-source-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.gt-wizard-source-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}
.gt-wizard-source-badge {
    margin-top: 6px;
    background: var(--wz-tc);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 8px;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.gt-wizard-source-badge--neutral {
    background: #e5e7eb;
    color: #6b7280;
}
.gt-wizard-source-card--recommended .gt-wizard-source-badge { background: var(--wz-tc); }

/* ── Form fields (Step 2) ────────────────────────────────────────────────── */
.gt-wizard-field { margin-bottom: 18px; }
.gt-wizard-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.gt-wizard-required { color: #ef4444; margin-left: 2px; }
.gt-wizard-field input[type="text"],
.gt-wizard-field input[type="url"],
.gt-wizard-field select {
    width: 100%;
    max-width: 480px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    background: #fff;
    transition: border-color .12s ease, box-shadow .12s ease;
}
.gt-wizard-field input:focus,
.gt-wizard-field select:focus {
    outline: none;
    border-color: var(--wz-tc);
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
.gt-wizard-field .description { font-size: 12px; color: #6b7280; margin: 4px 0 0; }

.gt-wizard-test-json {
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.gt-wizard-test-json .dashicons { font-size: 16px; width: 16px; height: 16px; }
.gt-wizard-test-json.is-loading .dashicons { animation: gt-wizard-spin 1s linear infinite; }

.gt-wizard-test-result {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 6px;
    border: 1px solid;
}
.gt-wizard-test-result.success { background: var(--wz-light); border-color: var(--wz-border); color: var(--wz-dark); }
.gt-wizard-test-result.error   { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

.gt-wizard-info-box {
    background: var(--wz-light);
    border: 1px solid var(--wz-border);
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--wz-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}
.gt-wizard-info-box .dashicons { flex-shrink: 0; }

/* ── Column picker (Step 3) ──────────────────────────────────────────────── */
.gt-wizard-col-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.gt-wizard-col-count { font-size: 12px; color: #6b7280; margin-left: 4px; }
.gt-wizard-cols-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6b7280;
    padding: 24px 0;
}
.gt-wizard-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--wz-tc);
    border-radius: 50%;
    animation: gt-wizard-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes gt-wizard-spin { to { transform: rotate(360deg); } }

.gt-wizard-cols-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px;
}
.gt-wizard-cols-list::-webkit-scrollbar { width: 4px; }
.gt-wizard-cols-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.gt-wizard-col-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .1s ease;
}
.gt-wizard-col-item:hover { background: #f9fafb; }
.gt-wizard-col-item input[type="checkbox"] { margin: 0; cursor: pointer; }
.gt-wizard-col-item input:checked + .gt-wizard-col-label { color: var(--wz-dark); font-weight: 500; }
.gt-wizard-col-label {
    font-size: 13px;
    color: #374151;
    flex: 1;
    cursor: pointer;
}
.gt-wizard-col-type {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 6px;
}
.gt-wizard-cols-error {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dc2626;
    font-size: 13px;
    padding: 12px 0;
}
.gt-wizard-cols-error .dashicons { color: #f87171; }

/* ── Display options (Step 4) ────────────────────────────────────────────── */
.gt-wizard-display-options { display: flex; flex-direction: column; gap: 0; }
.gt-wizard-display-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}
.gt-wizard-display-row:last-child { border-bottom: none; }
.gt-wizard-display-icon {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: var(--wz-tc);
    flex-shrink: 0;
}
.gt-wizard-display-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gt-wizard-display-info strong { font-size: 13px; color: #111827; }
.gt-wizard-display-info span  { font-size: 12px; color: #6b7280; }
.gt-wizard-display-control {
    min-width: 80px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.gt-wizard-display-control:focus {
    outline: none;
    border-color: var(--wz-tc);
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}

/* Toggle switch */
.gt-wizard-toggle { position: relative; display: block; width: 44px; height: 24px; cursor: pointer; }
.gt-wizard-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.gt-wizard-toggle-track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 12px;
    transition: background .2s ease;
}
.gt-wizard-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s ease;
}
.gt-wizard-toggle input:checked + .gt-wizard-toggle-track { background: var(--wz-tc); }
.gt-wizard-toggle input:checked + .gt-wizard-toggle-track::after { transform: translateX(20px); }

/* ── Summary (Step 5) ────────────────────────────────────────────────────── */
.gt-wizard-summary {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: var(--wz-radius);
    overflow: hidden;
    margin-bottom: 20px;
}
.gt-wizard-summary-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.gt-wizard-summary-row:last-child { border-bottom: none; }
.gt-wizard-summary-label {
    font-size: 12px;
    color: #6b7280;
    width: 120px;
    flex-shrink: 0;
    font-weight: 500;
}
.gt-wizard-summary-value { font-size: 13px; color: #111827; font-weight: 500; }

/* ── Success state ───────────────────────────────────────────────────────── */
.gt-wizard-success-banner {
    background: var(--wz-light);
    border: 1px solid var(--wz-border);
    border-radius: 6px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--wz-dark);
    font-size: 15px;
    margin-bottom: 20px;
}
.gt-wizard-success-banner .dashicons { font-size: 22px; width: 22px; height: 22px; color: var(--wz-tc); }
.gt-wizard-shortcode-box {
    background: #1e293b;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.gt-wizard-shortcode-label { font-size: 12px; color: #94a3b8; margin: 0 0 8px; }
.gt-wizard-shortcode-row { display: flex; align-items: center; gap: 10px; }
.gt-wizard-shortcode-code {
    font-family: monospace;
    font-size: 14px;
    color: #5eead4;
    background: transparent;
    border: none;
    padding: 0;
    flex: 1;
    word-break: break-all;
}
.gt-wizard-copy-shortcode {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.1) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255,255,255,.2) !important;
    font-size: 12px !important;
}
.gt-wizard-copy-shortcode:hover { background: rgba(255,255,255,.18) !important; }
.gt-wizard-copy-shortcode .dashicons { font-size: 14px; width: 14px; height: 14px; }
.gt-wizard-success-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Create error ────────────────────────────────────────────────────────── */
.gt-wizard-create-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 14px;
}
.gt-wizard-create-error .dashicons { color: #f87171; flex-shrink: 0; }

/* ── Navigation bar ──────────────────────────────────────────────────────── */
.gt-wizard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}
.gt-wizard-cancel {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
}
.gt-wizard-cancel:hover { color: #374151; }
.gt-wizard-nav-right { display: flex; gap: 10px; align-items: center; }
.gt-wizard-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.gt-wizard-btn-create .dashicons { font-size: 16px; width: 16px; height: 16px; }
.gt-wizard-btn-create.is-loading { opacity: .7; pointer-events: none; }

/* ── Validation message ──────────────────────────────────────────────────── */
.gt-wizard-validation-msg {
    color: #dc2626;
    font-size: 12px;
    margin: 10px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .gt-wizard-source-grid { grid-template-columns: 1fr; }
    .gt-wizard-indicator { flex-wrap: nowrap; overflow-x: auto; }
    .gt-wizard-step-label { display: none; }
}
