/* ── Schema Markup Generator ─────────────────────────────────────────────── */
.smg-section {
    --tool-accent: #6366F1;
    --tool-accent-rgb: 99, 102, 241;
}

.smg-card {
    padding: 1.25rem;
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.smg-top-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.smg-top-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.smg-type-select {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #1e293b);
    font-size: 0.9375rem;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    min-width: 180px;
    max-width: 260px;
}

.smg-type-select:focus {
    outline: none;
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px rgba(var(--tool-accent-rgb), 0.12);
}

.smg-generate-btn {
    background: var(--primary-gradient, linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%));
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.smg-generate-btn:hover {
    opacity: 0.88;
}

.smg-reset-btn {
    background: transparent;
    color: var(--text-secondary, #64748b);
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.smg-reset-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* ── 2-col layout ─────────────────────────────────────────────────────────── */
.smg-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* ── Form column ──────────────────────────────────────────────────────────── */
.smg-form-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Field groups */
.smg-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.smg-group-title {
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tool-accent);
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(var(--tool-accent-rgb), 0.2);
    margin-bottom: 0.15rem;
}

.smg-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.smg-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
}

.smg-label .smg-optional {
    font-weight: 400;
    font-size: 0.9375rem;
    color: var(--text-muted, #94a3b8);
    margin-left: 0.25rem;
}

.smg-input,
.smg-textarea,
.smg-select {
    padding: 0.42rem 0.6rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #1e293b);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.smg-input:focus,
.smg-textarea:focus,
.smg-select:focus {
    outline: none;
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px rgba(var(--tool-accent-rgb), 0.12);
}

.smg-textarea {
    resize: vertical;
}

/* ── Repeatable rows (FAQ items, Breadcrumbs, HowTo steps, etc.) ─────────── */
.smg-repeat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.smg-repeat-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
}

.smg-add-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.6rem;
    border: 1px solid var(--tool-accent);
    border-radius: 6px;
    background: transparent;
    color: var(--tool-accent);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.smg-add-btn:hover {
    background: rgba(var(--tool-accent-rgb), 0.08);
}

.smg-repeat-rows {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.smg-repeat-row {
    border: 1px solid var(--border-color, #e8eef5);
    border-radius: 8px;
    padding: 0.65rem;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--bg-muted, #f8fafc);
}

.smg-repeat-row .smg-row-num {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--tool-accent);
    margin-bottom: 0.15rem;
}

.smg-remove-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    font-size: 0.9375rem;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.smg-remove-btn:hover {
    color: #ef4444;
}

/* ── Output column ────────────────────────────────────────────────────────── */
.smg-output-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
}

.smg-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: rgba(var(--tool-accent-rgb), 0.07);
    border: 1px solid rgba(var(--tool-accent-rgb), 0.25);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tool-accent);
}

.smg-output-actions {
    display: flex;
    gap: 0.5rem;
}

.smg-form-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(var(--tool-accent-rgb), 0.15);
    margin-top: 0.5rem;
}

.smg-output-pre {
    margin: 0;
    padding: 0.9rem 1rem;
    background: var(--bg-muted, #f8fafc);
    border: 1px solid rgba(var(--tool-accent-rgb), 0.25);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow-x: auto;
    max-height: none;
    overflow-y: auto;
}

.smg-output-pre code {
    font-size: 1rem;
    font-family: 'Consolas', 'Fira Code', monospace;
    color: var(--text-primary, #1e293b);
    white-space: pre;
    tab-size: 2;
}

/* ── Script tag box ───────────────────────────────────────────────────────── */
.smg-script-tag-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: var(--bg-muted, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
}

.smg-script-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    color: var(--text-secondary, #64748b);
}

/* ── Info box ─────────────────────────────────────────────────────────────── */
.smg-info-box {
    padding: 0.75rem 1rem;
    background: rgba(var(--tool-accent-rgb), 0.05);
    border: 1px solid rgba(var(--tool-accent-rgb), 0.2);
    border-radius: 8px;
}

.smg-info-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--tool-accent);
    margin-bottom: 0.5rem;
}

.smg-info-list {
    margin: 0;
    padding: 0 0 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.smg-info-list li {
    font-size: 0.9375rem;
    color: var(--text-secondary, #64748b);
}

.smg-info-list a {
    color: var(--tool-accent);
    text-decoration: none;
}

.smg-info-list a:hover {
    text-decoration: underline;
}

/* ── Required marker ──────────────────────────────────────────────────────── */
.smg-required {
    color: #ef4444;
    margin-left: 0.15rem;
}

/* ── Validation errors ────────────────────────────────────────────────────── */
.smg-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.smg-error-msg {
    display: block;
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.15rem;
}

/* ── Article sub-type selector ────────────────────────────────────────────── */
.smg-subtype-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(var(--tool-accent-rgb), 0.05);
    border: 1px solid rgba(var(--tool-accent-rgb), 0.15);
    border-radius: 8px;
}

.smg-subtype-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}

.smg-subtype-select {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--input-bg, #fff);
    color: var(--text-primary, #1e293b);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    flex: 1;
    max-width: 220px;
}

.smg-subtype-select:focus {
    outline: none;
    border-color: var(--tool-accent);
    box-shadow: 0 0 0 3px rgba(var(--tool-accent-rgb), 0.12);
}

/* ── Output tabs (JSON-LD | Rich Preview) ─────────────────────────────────── */
.smg-output-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color, #e2e8f0);
    margin-bottom: 0;
}

.smg-out-tab {
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.smg-out-tab:hover {
    color: var(--tool-accent);
}

.smg-out-tab--active {
    color: var(--tool-accent);
    border-bottom-color: var(--tool-accent);
}

/* ── Rich snippet preview panel ───────────────────────────────────────────── */
.smg-preview-panel {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--bg-muted, #f8fafc);
    border: 1px solid rgba(var(--tool-accent-rgb), 0.25);
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.smg-preview-panel.smg-panel--active {
    display: flex;
}

.smg-preview-placeholder {
    text-align: center;
    color: var(--text-muted, #94a3b8);
    font-size: 0.9375rem;
    padding: 2rem 0;
}

/* Google SERP mockup */
.smg-serp {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: Arial, sans-serif;
}

.smg-serp-breadcrumb {
    font-size: 0.8rem;
    color: #202124;
    margin-bottom: 0.2rem;
}

.smg-serp-title {
    font-size: 1.125rem;
    color: #1a0dab;
    font-weight: 400;
    margin-bottom: 0.2rem;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.smg-serp-title:hover {
    text-decoration: underline;
}

.smg-serp-desc {
    font-size: 0.875rem;
    color: #4d5156;
    line-height: 1.5;
}

.smg-serp-stars {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: #70757a;
    margin-bottom: 0.2rem;
}

.smg-serp-star-filled {
    color: #f5a623;
}

.smg-serp-price {
    font-size: 0.8125rem;
    color: #202124;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.smg-serp-meta {
    font-size: 0.8125rem;
    color: #70757a;
    margin-bottom: 0.2rem;
}

/* FAQ accordion mockup */
.smg-serp-faq {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.smg-serp-faq-item {
    border-bottom: 1px solid #e8eaed;
    padding: 0.6rem 0;
}

.smg-serp-faq-item:last-child {
    border-bottom: none;
}

.smg-serp-faq-q {
    font-size: 0.9375rem;
    color: #202124;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.smg-serp-faq-q::after {
    content: '▾';
    font-size: 0.75rem;
    color: #70757a;
}

.smg-serp-faq-a {
    font-size: 0.875rem;
    color: #4d5156;
    margin-top: 0.35rem;
    line-height: 1.5;
}

/* Recipe & Event meta pills */
.smg-serp-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.smg-serp-pill {
    font-size: 0.75rem;
    color: #70757a;
    background: #f1f3f4;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Preview label */
.smg-preview-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.25rem;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .smg-layout {
        grid-template-columns: 1fr;
    }

    .smg-output-col {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    .smg-form-actions {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .smg-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .smg-type-select {
        max-width: 100%;
    }
}