/* Page CSS for JSON Schema Validator.
   Loaded after the shared css/style.css. Intentionally does NOT redeclare
   body { font-family } — the shared stylesheet owns the system font stack. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

body.dark-mode .container { background: #252525; border-color: #404040; }

header {
    background: #ffffff;
    color: #333;
    padding: 24px 80px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

body.dark-mode header { background: #2d2d2d; border-bottom-color: #404040; color: #e0e0e0; }

header h1 { font-size: 20px; margin-bottom: 8px; color: #333; font-weight: 600; letter-spacing: -0.3px; }
body.dark-mode header h1 { color: #e0e0e0; }
header p { font-size: 11px; color: #64748b; margin: 0; font-weight: 400; }
header p.header-description { display: block; }
body.dark-mode header p { color: #94a3b8; }

/* Buttons */
button {
    padding: 0px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #2563eb;
    color: white;
    height: 34px;
}

button:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.15); }
button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

button.secondary { background: #6c757d; }
button.secondary:hover { background: #5a6268; }
button.success { background: #218838; color: #fff; }
button.success:hover { background: #1e7e34; }
button.danger { background: #dc3545; }
button.danger:hover { background: #c82333; }
button.primary { background: #2563eb; }
button.primary:hover { background: #1d4ed8; }
button.small { padding: 0px 14px; font-size: 12px; font-weight: 500; height: 30px; border-radius: 6px; }

button:disabled, button:disabled:hover { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid #0066cc; outline-offset: 2px; }

body.dark-mode button { color: white; }

/* Main tool area */
.sv-main-content { padding: 20px; }

.sv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.sv-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 12px;
    flex-wrap: wrap;
    min-height: 34px;
}

.sv-panel-header h2 { margin: 0; font-size: 15px; font-weight: 600; color: #333; }
body.dark-mode .sv-panel-header h2 { color: #e0e0e0; }
.sv-panel-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.sv-textarea {
    display: block;
    width: 100%;
    height: 320px;
    padding: 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 20px;
    tab-size: 4;
    white-space: pre;            /* no soft wrapping: lines map 1:1 so "Jump to location" can scroll accurately */
    overflow: auto;
    resize: vertical;
    background: #fff;
    color: #333;
}

.sv-textarea::placeholder { color: #6b7280; opacity: 1; }
.sv-textarea:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0,102,204,0.12); }
body.dark-mode .sv-textarea { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }
body.dark-mode .sv-textarea::placeholder { color: #9ca3af; }
.sv-textarea::selection { background: #ffd54f; color: #000; }

.sv-line { min-height: 22px; margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: #475569; overflow-wrap: anywhere; }
body.dark-mode .sv-line { color: #b8bfcc; }

.sv-panel-actions a { font-size: 13px; font-weight: 500; color: #1d4ed8; text-decoration: underline !important; }
body.dark-mode .sv-panel-actions a { color: #6bb6ff; }

/* Options + actions bar */
.sv-bar {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    align-items: center;
}
body.dark-mode .sv-bar { border-color: #404040; background: #2d2d2d; }

.sv-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #374151; }
body.dark-mode .sv-opt { color: #d5dae3; }
.sv-opt select {
    height: 36px;
    padding: 0 8px;
    border: 1.5px solid #9ca3af;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 13px;
}
body.dark-mode .sv-opt select { background: #1a1a1a; border-color: #6b7280; color: #e0e0e0; }
.sv-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #333; cursor: pointer; min-height: 36px; }
body.dark-mode .sv-check { color: #e0e0e0; }
.sv-check input { width: 16px; height: 16px; cursor: pointer; accent-color: #0066cc; flex-shrink: 0; }

.sv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sv-actions button { height: 36px; }
.sv-actions button.sv-validate { height: 38px; padding: 0 24px; font-weight: 600; }

.sv-note { margin-top: 12px; font-size: 12.5px; line-height: 1.6; color: #475569; }
body.dark-mode .sv-note { color: #b8bfcc; }

/* Results: the summary line, warnings box and error list have fixed space, so
   results appearing never move the content below. */
.sv-results { margin-top: 22px; }
.sv-results-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; min-height: 34px; }
.sv-results-head h2 { font-size: 15px; font-weight: 600; color: #333; margin: 0; }
body.dark-mode .sv-results-head h2 { color: #e0e0e0; }

.sv-status {
    height: 112px;
    overflow-y: auto;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    color: #475569;
}
.sv-summary { font-size: 15px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.sv-detail { font-size: 13px; line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.sv-notices { list-style: none; margin-top: 4px; }
.sv-notice { font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.sv-status.neutral { color: #475569; }
.sv-status.error { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.sv-status.success { background: #d4edda; color: #155724; border-color: #28a745; }
.sv-status.warning { background: #fff3cd; color: #664d03; border-color: #e0a800; }
body.dark-mode .sv-status, body.dark-mode .sv-status.neutral { color: #b8bfcc; }
body.dark-mode .sv-status.error { background: #3d1f1f; color: #ffb3b3; border-color: #dc3545; }
body.dark-mode .sv-status.success { background: #1e3a24; color: #b7f0c0; border-color: #28a745; }
body.dark-mode .sv-status.warning { background: #3a2f0b; color: #ffe08a; border-color: #b8860b; }

.sv-warnings { margin-top: 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
body.dark-mode .sv-warnings { border-color: #404040; background: #2d2d2d; }
.sv-warnings summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: #664d03; padding: 10px 14px; min-height: 44px; display: list-item; }
body.dark-mode .sv-warnings summary { color: #ffe08a; }
.sv-warn-box { max-height: 140px; overflow-y: auto; padding: 4px 14px 12px; }
.sv-warn-box ul { list-style: none; }
.sv-warn { font-size: 12.5px; line-height: 1.5; padding: 4px 8px; margin-bottom: 4px; border-radius: 6px; background: #fff3cd; color: #664d03; overflow-wrap: anywhere; }
.sv-warn-none { font-size: 12.5px; color: #475569; }
body.dark-mode .sv-warn { background: #3a2f0b; color: #ffe08a; }
body.dark-mode .sv-warn-none { color: #b8bfcc; }

.sv-errors-wrap {
    margin-top: 10px;
    height: 380px;
    overflow-y: auto;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}
body.dark-mode .sv-errors-wrap { border-color: #404040; background: #1a1a1a; }
.sv-placeholder { font-size: 13px; color: #475569; padding: 6px 4px; }
body.dark-mode .sv-placeholder { color: #b8bfcc; }
.sv-errors { list-style: none; }
.sv-err {
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #dc3545;
    border-radius: 6px;
    background: #fff;
}
body.dark-mode .sv-err { border-color: #404040; border-left-color: #dc3545; background: #252525; }
.sv-err-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.sv-path { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; font-weight: 700; color: #7a1c1c; overflow-wrap: anywhere; word-break: break-word; }
body.dark-mode .sv-path { color: #ffb3b3; }
.sv-kw { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eef2ff; color: #1e3a8a; border: 1px solid #c7d2fe; }
body.dark-mode .sv-kw { background: #2a3350; color: #c7d7ff; border-color: #3b4a73; }
.sv-msg { font-size: 13.5px; line-height: 1.5; color: #1f2937; overflow-wrap: anywhere; }
body.dark-mode .sv-msg { color: #e5e9f0; }
.sv-params, .sv-raw { font-size: 12.5px; line-height: 1.5; color: #475569; overflow-wrap: anywhere; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; }
body.dark-mode .sv-params, body.dark-mode .sv-raw { color: #b8bfcc; }
.sv-err .sv-jump { margin-top: 8px; }
.sv-more { min-height: 22px; margin-top: 6px; font-size: 12.5px; color: #475569; }
body.dark-mode .sv-more { color: #b8bfcc; }

code { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.92em; background: #eef1f4; color: #1f2937; padding: 1px 5px; border-radius: 4px; }
body.dark-mode code { background: #333a45; color: #e5e9f0; }

/* Long-form content */
.sv-content { padding: 28px 30px 8px; border-top: 1px solid #e5e7eb; margin-top: 24px; }
body.dark-mode .sv-content { border-top-color: #404040; }
.sv-content h2 { font-size: 22px; font-weight: 600; margin: 30px 0 12px; color: #1f2937; }
.sv-content h2:first-child { margin-top: 0; }
.sv-content h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; color: #0052a3; }
body.dark-mode .sv-content h2 { color: #e5e9f0; }
body.dark-mode .sv-content h3 { color: #6bb6ff; }
.sv-content p { font-size: 14.5px; line-height: 1.75; color: #3b4351; margin-bottom: 12px; max-width: 90ch; }
body.dark-mode .sv-content p { color: #ccc; }
.sv-content ul { margin: 0 0 14px 22px; font-size: 14.5px; line-height: 1.8; color: #3b4351; max-width: 90ch; }
body.dark-mode .sv-content ul { color: #ccc; }
.sv-content a { color: #1d4ed8; }
body.dark-mode .sv-content a { color: #6bb6ff; }
/* style.css strips underlines from every link with !important; body-text links need one back */
.sv-content p a, .sv-content li a, .sv-line a, .sv-note a { text-decoration: underline !important; }
.sv-answer { font-size: 15px; font-weight: 500; }

pre.sv-code {
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.55;
    color: #1f2937;
    max-width: 100%;
}
body.dark-mode pre.sv-code { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }
.sv-code-label { font-size: 12px; font-weight: 600; color: #475569; margin: 0 0 4px !important; }
body.dark-mode .sv-code-label { color: #b8bfcc; }

.faq-section { padding: 28px 30px 40px; }
.faq-section h2 { font-size: 22px; font-weight: 600; color: #1f2937; margin-bottom: 16px; }
body.dark-mode .faq-section h2 { color: #e5e9f0; }
.faq-item { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 10px; padding: 14px 18px; background: #fff; }
body.dark-mode .faq-item { border-color: #404040; background: #2d2d2d; }
.faq-question { cursor: pointer; font-weight: 600; font-size: 14px; color: #333; }
body.dark-mode .faq-question { color: #e0e0e0; }
.faq-answer p { font-size: 13.5px; line-height: 1.7; color: #4b5563; margin-top: 10px; }
body.dark-mode .faq-answer p { color: #b8bfcc; }

/* "Built by" note */
.builder-note { text-align: center; padding: 16px 24px; background: #f0f4ff; border-top: 1px solid #dde4f0; font-size: 0.95rem; color: #444; }
.builder-note p { line-height: 1.6; }
body.dark-mode .builder-note { background: #1e2433; border-top-color: #2d3748; color: #b8bfcc; }
body.dark-mode .builder-note a { color: #6bb6ff; }

/* Footer */
footer { margin-top: 30px; border-top: 1px solid #e5e7eb; color: #666; font-size: 12px; }
.footer-content { max-width: 1400px; margin: 0 auto; padding: 30px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; text-align: left; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand-name { font-weight: 700; color: #333; font-size: 15px; }
body.dark-mode .footer-brand-name { color: #e0e0e0; }
.footer-section p { margin: 0 0 10px 0; line-height: 1.6; color: #666; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section ul li { padding: 4px 0; color: #666; line-height: 1.5; }
.footer-section ul li a { color: #0066cc; text-decoration: none; }
.footer-section ul li a:hover { text-decoration: underline; }
.footer-bottom { text-align: center; padding: 20px; border-top: 1px solid #e5e7eb; background: #f9fafb; }
.footer-bottom p { margin: 0 0 15px 0; }
.footer-links { display: flex !important; align-items: center; justify-content: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.footer-links a { color: #6b7c94 !important; text-decoration: none; white-space: nowrap; }
.footer-links a:hover { color: #a5b4fc !important; text-decoration: underline; }
.footer-separator { color: #999; margin: 0 4px; }

body.dark-mode footer { border-top-color: #404040; background: #1a1a1a; }
body.dark-mode .footer-content { background: #1a1a1a; }
body.dark-mode .footer-section p,
body.dark-mode .footer-section ul li { color: #b0b0b0; }
body.dark-mode .footer-section ul li a { color: #6bb6ff; }
body.dark-mode .footer-bottom { background: #252525; border-top-color: #404040; }
body.dark-mode .footer-links a { color: #6a7990 !important; }
body.dark-mode .footer-links a:hover { color: #a5b4fc !important; }
body.dark-mode .footer-separator { color: #666; }

/* Responsive: stacked layout on mobile, same 768px breakpoint as the sibling pages */
@media (max-width: 768px) {
    body { padding: 5px; }
    .container { border-radius: 0; margin: 0; max-width: 100%; }
    header { padding: 15px 15px; text-align: left; }
    header h1 { font-size: 16px; line-height: 1.3; margin-bottom: 6px; text-align: center; }
    header p { font-size: 10px; line-height: 1.4; text-align: center; }

    .sv-main-content { padding: 15px 10px; }
    .sv-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .sv-textarea { height: 240px; }
    .sv-panel-actions { width: 100%; }
    .sv-panel-actions a { display: inline-flex; align-items: center; min-height: 48px; }
    .sv-bar { gap: 8px 16px; }
    .sv-opt select { height: 48px; font-size: 16px; }

    /* Minimum 48x48px touch targets */
    button, button.small { min-height: 48px; min-width: 48px; }
    .sv-check { min-height: 48px; }
    .sv-check input { width: 22px; height: 22px; }
    .sv-actions button { flex: 1 1 auto; }
    .sv-warnings summary, .faq-question { min-height: 48px; padding: 13px 14px; }
    .faq-question { padding-left: 0; padding-right: 0; }
    .sv-errors-wrap { height: 340px; }
    .sv-status { height: 150px; }

    .sv-content { padding: 20px 12px 4px; }
    .sv-content h2 { font-size: 20px; }
    .faq-section { padding: 20px 12px 28px; }
    .builder-note { padding: 16px 15px; }

    .footer-content { grid-template-columns: 1fr; gap: 20px; padding: 20px 15px; }
    .footer-section { text-align: center; }
    .footer-section ul { text-align: left; display: inline-block; }
}
