/* ==========================================================
   WISAXIS — AI JSON EXTRACTOR (2026 SaaS Design System)
   Multimodal document upload, IDE code viewer, OCR text & cards.
   ========================================================== */

.json-features-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-4) var(--space-8);
}

/* ── Page Header (Symmetrical Hero) ── */
.page-header {
    margin-bottom: var(--space-6);
    text-align: center;
    position: relative;
}

.ai-model-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    margin-bottom: var(--space-3);
    box-shadow: 0 2px 12px var(--primary-glow);
}

.ai-model-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 8px var(--secondary);
    display: inline-block;
}

.page-title {
    font-family: var(--font-heading);
    font-size: var(--text-4xl);
    font-weight: 900;
    letter-spacing: var(--tracking-tighter);
    margin-bottom: var(--space-2);
    color: var(--text-main);
    line-height: var(--leading-tight);
}

.page-subtitle {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    max-width: 680px;
    margin: 0 auto 18px;
    line-height: var(--leading-normal);
}

.header-feature-pills {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.header-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

/* ── Upload Card ── */
.ai-upload-card {
    background: var(--surface-paper);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

html[data-theme="light"] .ai-upload-card {
    background: #ffffff;
    border-color: var(--border-default);
    box-shadow: var(--shadow-xs);
}

.upload-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.mode-selector-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.mode-select {
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    color: var(--text-main);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mode-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s, transform 0.2s;
    position: relative;
    background: var(--surface-2);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--surface-3);
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--surface-3);
    transform: scale(1.015);
    animation: borderGlowBreath 1.5s infinite ease-in-out;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.upload-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: var(--radius-lg);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.upload-zone:hover .upload-icon-wrap {
    transform: scale(1.08);
}

.upload-text {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 6px;
    letter-spacing: var(--tracking-snug);
}

.upload-hint {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    margin-bottom: 16px;
}

.file-type-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.file-type-badge {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: var(--radius-full);
    padding: 4px 12px;
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
}

/* Clipboard Paste Notice */
.paste-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.kbd-shortcut {
    background: var(--surface-3);
    border: 1px solid var(--surface-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-main);
}

/* File Preview Strip */
.file-preview-strip {
    display: none;
    align-items: center;
    gap: 14px;
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 16px;
}

.file-preview-strip .fp-icon {
    font-size: 2rem;
}

.file-preview-strip .fp-info {
    flex: 1;
    min-width: 0;
}

.file-preview-strip .fp-name {
    font-weight: 700;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.file-preview-strip .fp-size {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-top: 2px;
}

.fp-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Progress Steps */
.ai-progress {
    display: none;
    margin-top: 20px;
}

.ai-progress-bar-bg {
    background: var(--surface-2);
    border-radius: var(--radius-full);
    height: 6px;
    overflow: hidden;
}

.ai-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-brand);
    transition: width 0.5s ease;
    width: 0%;
}

.ai-progress-label {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}

/* Alert Notices */
.ai-alert {
    display: none;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    margin-top: 16px;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
}

.ai-alert-error {
    background: var(--danger-light);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: var(--danger);
}

.ai-alert-success {
    background: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--success);
}

/* Extract Button */
.extract-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gradient-brand);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-tight);
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 20px var(--primary-glow);
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.extract-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 26px var(--primary-glow);
    filter: brightness(1.06);
}

.extract-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Result Tabs & Cards ── */
.result-tabs-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.result-tab-btn {
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s var(--ease-spring);
}

.result-tab-btn:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: var(--surface-3);
}

.result-tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* ── Code Editor Viewer ── */
.editor-window {
    background: var(--bg-secondary, #000000);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.editor-titlebar {
    background: var(--surface-paper);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.editor-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.editor-dot.red { background: #ff5f56; }
.editor-dot.yellow { background: #ffbd2e; }
.editor-dot.green { background: #27c93f; }

.editor-filename {
    color: var(--text-secondary);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    margin-left: 4px;
}

.editor-tag {
    background: var(--surface-2);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: var(--text-3xs);
    font-weight: 600;
}

.editor-right-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.editor-mini-btn {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.editor-mini-btn:hover {
    background: var(--surface-2);
    color: var(--text-main);
    border-color: var(--border-strong);
}

.editor-body {
    display: flex;
    background: var(--bg-secondary, #000000);
    max-height: 560px;
    overflow-y: auto;
}

.editor-gutter {
    width: 48px;
    padding: 18px 10px 18px 0;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-align: right;
    user-select: none;
    line-height: 1.6;
    border-right: 1px solid var(--border-subtle);
}

.json-code-block {
    flex: 1;
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre;
    overflow-x: auto;
    line-height: 1.6;
    margin: 0;
}

.json-code-block.wrap-lines {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Syntax colors */
.json-key { color: #38bdf8; font-weight: 700; }
.json-string { color: #2dd4bf; }
.json-number { color: #fb923c; font-weight: 600; }
.json-boolean { color: #f43f5e; font-weight: 700; }
.json-null { color: var(--text-dim); font-style: italic; }

/* ── Raw Text / OCR Inspector ── */
.rawtext-wrap {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.rawtext-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-paper);
    padding: 12px 18px;
    border-bottom: 1px solid var(--surface-border);
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    color: var(--text-muted);
    font-weight: 600;
    flex-wrap: wrap;
    gap: 8px;
}

.rawtext-left-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rawtext-badge {
    font-weight: 800;
    color: var(--text-main);
    font-size: var(--text-xs);
}

.rawtext-body {
    padding: 24px;
    max-height: 560px;
    overflow-y: auto;
    background: var(--surface-1);
}

.rawtext-content {
    font-family: var(--font-body);
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* ── Visual Dashboard Grid ── */
.visual-tree-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.visual-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.visual-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.visual-card {
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.visual-card:hover {
    border-color: var(--surface-border-hover);
}

.visual-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 10px;
}

.visual-card-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-snug);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.visual-item {
    background: var(--surface-1);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
}

.visual-item-label {
    font-family: var(--font-body);
    font-size: var(--text-3xs);
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    margin-bottom: 4px;
}

.visual-item-value {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-main);
    font-weight: 600;
    word-break: break-word;
}

.timeline-item {
    border-left: 2px solid var(--primary);
    padding-left: 14px;
    margin-bottom: 16px;
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary-glow);
}

.timeline-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: var(--text-sm);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-sub {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 2px 0 6px;
    font-weight: 600;
}

.timeline-desc {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    color: var(--text-main);
    white-space: pre-wrap;
    line-height: 1.5;
}

.skill-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-chip {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(14, 165, 233, 0.22);
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
}

/* Buttons */
.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(14, 165, 233, 0.4);
    background: var(--primary-light);
    color: var(--primary);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-action-primary:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-action-builder {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gradient-brand);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-action-builder:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px var(--primary-glow);
}

/* Schema Reference Card */
.schema-card {
    background: var(--surface-paper);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-top: 24px;
}

.schema-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: var(--space-3);
}

.schema-title {
    font-family: var(--font-heading);
    font-size: var(--text-md);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    color: var(--text-main);
}

.schema-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 800;
}

.code-block {
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}
