/* ==========================================================================
   Schema Markup Generator — schgen-style.css
   Prefix: schgen-
   ========================================================================== */

.schgen-wrap *,
.schgen-wrap *::before,
.schgen-wrap *::after {
    box-sizing: border-box;
}

.schgen-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 48px;
}

.schgen-main-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.schgen-main-subtitle {
    font-size: 0.92rem;
    color: #6b7280;
    margin: 0 0 26px;
}

.schgen-main-subtitle code {
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #e53935;
}

/* --------------------------------------------------------------------------
   Two-column layout
   -------------------------------------------------------------------------- */
.schgen-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .schgen-layout { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.schgen-card {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.schgen-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

/* --------------------------------------------------------------------------
   Schema type selector
   -------------------------------------------------------------------------- */
.schgen-type-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    margin-bottom: 8px;
}

.schgen-type-select {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    background: #fafafa;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
}

.schgen-type-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* --------------------------------------------------------------------------
   Dynamic form fields
   -------------------------------------------------------------------------- */
.schgen-field {
    margin-bottom: 16px;
}

.schgen-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    margin-bottom: 5px;
}

.schgen-req { color: #e53935; }

.schgen-field input[type="text"],
.schgen-field input[type="url"],
.schgen-field input[type="email"],
.schgen-field input[type="tel"],
.schgen-field input[type="number"],
.schgen-field input[type="date"],
.schgen-field input[type="datetime-local"],
.schgen-field textarea,
.schgen-field select {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fafafa;
    color: #1f2937;
    transition: border-color 0.2s;
}

.schgen-field input:focus,
.schgen-field textarea:focus,
.schgen-field select:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.schgen-field textarea { resize: vertical; min-height: 72px; }

.schgen-field .schgen-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 4px 0 0;
}

/* field group (2-col) */
.schgen-field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 520px) {
    .schgen-field-group { grid-template-columns: 1fr; }
}

/* section divider inside form */
.schgen-section-divider {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 6px;
    margin: 20px 0 14px;
}

/* --------------------------------------------------------------------------
   Dynamic list items (FAQ pairs, ingredients, steps, sameAs, etc.)
   -------------------------------------------------------------------------- */
.schgen-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.schgen-list-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 12px 14px;
    position: relative;
}

.schgen-list-item .schgen-item-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.schgen-list-item input,
.schgen-list-item textarea {
    width: 100%;
    padding: 7px 10px;
    font-size: 0.88rem;
    font-family: inherit;
    border: 1.5px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    color: #1f2937;
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.schgen-list-item input:last-child,
.schgen-list-item textarea:last-child {
    margin-bottom: 0;
}

.schgen-list-item input:focus,
.schgen-list-item textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.schgen-list-item textarea { resize: vertical; min-height: 56px; }

.schgen-remove-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.schgen-remove-btn:hover { color: #e53935; background: #fef2f2; }

.schgen-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    background: #eff6ff;
    color: #2563eb;
    border: 1.5px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.schgen-add-btn:hover { background: #dbeafe; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.schgen-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.schgen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.schgen-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.schgen-btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.schgen-btn-outline {
    background: transparent;
    color: #2563eb;
    border-color: #2563eb;
}
.schgen-btn-outline:hover { background: #eff6ff; }

.schgen-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: #e5e7eb;
}
.schgen-btn-ghost:hover { background: #f9fafb; }

/* --------------------------------------------------------------------------
   Errors
   -------------------------------------------------------------------------- */
.schgen-errors {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 7px;
    padding: 12px 16px;
    margin-top: 14px;
}

.schgen-errors ul {
    margin: 0;
    padding: 0 0 0 18px;
    color: #991b1b;
    font-size: 0.86rem;
}

/* --------------------------------------------------------------------------
   Output panel
   -------------------------------------------------------------------------- */
.schgen-output-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 4px;
}

.schgen-output-header .schgen-card-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.schgen-output-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.schgen-output-actions .schgen-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
}

.schgen-placeholder {
    text-align: center;
    padding: 36px 20px;
    color: #9ca3af;
}

.schgen-placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.4;
    font-family: monospace;
    font-weight: 700;
}

.schgen-placeholder p { font-size: 0.9rem; margin: 0; }

/* --------------------------------------------------------------------------
   JSON-LD code block with syntax highlighting
   -------------------------------------------------------------------------- */
.schgen-output {
    background: #0f172a;
    border-radius: 8px;
    padding: 18px 20px;
    overflow-x: auto;
    max-height: 540px;
    overflow-y: auto;
    margin: 14px 0 0;
    font-size: 0.82rem;
    line-height: 1.65;
}

.schgen-output code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    white-space: pre;
    color: #e2e8f0;
}

/* Syntax token colours */
.schgen-tok-key   { color: #93c5fd; }  /* keys — blue */
.schgen-tok-str   { color: #86efac; }  /* string values — green */
.schgen-tok-num   { color: #fcd34d; }  /* numbers — amber */
.schgen-tok-bool  { color: #f9a8d4; }  /* true/false/null — pink */
.schgen-tok-punct { color: #94a3b8; }  /* brackets, commas — slate */

/* --------------------------------------------------------------------------
   Validation
   -------------------------------------------------------------------------- */
.schgen-validation {
    margin-top: 14px;
    font-size: 0.84rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 7px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.schgen-validation.schgen-val-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

/* --------------------------------------------------------------------------
   How-to use panel
   -------------------------------------------------------------------------- */
.schgen-how-card {
    background: #f8faff;
    border-color: #dde3ea;
}

.schgen-how-list {
    margin: 0;
    padding: 0 0 0 20px;
    color: #374151;
    font-size: 0.88rem;
    line-height: 1.8;
}

.schgen-how-list a { color: #2563eb; }
.schgen-how-list code {
    background: #e0e7ff;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.82em;
    color: #3730a3;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .schgen-card { padding: 16px 14px; }
    .schgen-btn  { width: 100%; justify-content: center; }
    .schgen-btn-row { flex-direction: column; }
    .schgen-output-actions { width: 100%; }
    .schgen-output-actions .schgen-btn { flex: 1; justify-content: center; }
}
