/* Page CSS for JSONPath Tester.
   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:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #0066cc; outline-offset: 2px; }

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

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

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

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

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

.jp-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: 1.55;
    overflow-wrap: anywhere;
    resize: vertical;
    background: #fff;
    color: #333;
}

.jp-textarea::placeholder, .jp-expr-input::placeholder { color: #6b7280; opacity: 1; }
body.dark-mode .jp-textarea::placeholder, body.dark-mode .jp-expr-input::placeholder { color: #9ca3af; }

.jp-textarea:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0,102,204,0.12); }
body.dark-mode .jp-textarea { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }

/* Status lines. Space is always reserved, so a message appearing or changing
   never moves the controls below it. */
.jp-status {
    min-height: 44px;
    margin: 6px 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    color: #475569;
}

.jp-status.neutral { color: #475569; }
.jp-status.error { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.jp-status.warning { background: #fff3cd; color: #664d03; border-color: #e0a800; }
.jp-status.success { background: #d4edda; color: #155724; border-color: #28a745; }
body.dark-mode .jp-status, body.dark-mode .jp-status.neutral { color: #b8bfcc; }
body.dark-mode .jp-status.error { background: #3d1f1f; color: #ffb3b3; border-color: #dc3545; }
body.dark-mode .jp-status.warning { background: #3a2f0b; color: #ffe08a; border-color: #b8860b; }
body.dark-mode .jp-status.success { background: #1e3a24; color: #b7f0c0; border-color: #28a745; }

/* Expression row */
.jp-expr-label { display: block; font-size: 15px; font-weight: 600; color: #333; margin: 4px 0 8px; }
body.dark-mode .jp-expr-label { color: #e0e0e0; }
.jp-expr-controls { display: flex; gap: 8px; }

.jp-expr-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    background: #fff;
    color: #333;
}

.jp-expr-input:focus { outline: none; border-color: #0066cc; box-shadow: 0 0 0 3px rgba(0,102,204,0.12); }
body.dark-mode .jp-expr-input { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }
.jp-expr-controls button { height: 38px; padding: 0 22px; font-weight: 600; }

/* Example chips */
.jp-chips-label { font-size: 12px; font-weight: 600; color: #475569; margin: 2px 0 6px; display: block; }
body.dark-mode .jp-chips-label { color: #b8bfcc; }
.jp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }

button.jp-chip {
    height: auto;
    min-height: 34px;
    padding: 6px 12px;
    border: 1.5px solid #c7d2fe;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: none;
    transform: none;
    overflow-wrap: anywhere;
    text-align: left;
}

button.jp-chip:hover { background: #e0e7ff; color: #1e3a8a; transform: none; box-shadow: none; }
body.dark-mode button.jp-chip { background: #2a3350; border-color: #3b4a73; color: #c7d7ff; }
body.dark-mode button.jp-chip:hover { background: #34406a; color: #dbe5ff; }

/* Show-paths toggle */
.jp-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #333; cursor: pointer; }
body.dark-mode .jp-toggle { color: #e0e0e0; }
.jp-toggle input { width: 16px; height: 16px; cursor: pointer; accent-color: #0066cc; }

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

/* Collapsible cheat sheet */
.jp-cheatsheet { margin-top: 18px; border: 1px solid #e5e7eb; border-radius: 8px; background: #f8fafc; }
body.dark-mode .jp-cheatsheet { border-color: #404040; background: #2d2d2d; }
.jp-cheatsheet summary { cursor: pointer; font-weight: 600; font-size: 14px; color: #333; padding: 12px 16px; min-height: 44px; display: list-item; }
body.dark-mode .jp-cheatsheet summary { color: #e0e0e0; }
.jp-cheat-grid { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 8px 16px; padding: 4px 16px 16px; font-size: 13.5px; line-height: 1.5; }
.jp-cheat-grid dt { font-weight: 600; }
.jp-cheat-grid dd { color: #444; }
body.dark-mode .jp-cheat-grid dd { color: #ccc; }

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

.jp-answer { font-size: 15px; font-weight: 500; }

pre.jp-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.jp-code { background: #1a1a1a; border-color: #404040; color: #e0e0e0; }
.jp-code-label { font-size: 12px; font-weight: 600; color: #475569; margin: 0 0 4px; }
body.dark-mode .jp-code-label { color: #b8bfcc; }

.jp-table-wrap { overflow-x: auto; margin-bottom: 16px; max-width: 100%; }
table.jp-ref { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; min-width: 520px; }
table.jp-ref th, table.jp-ref td { text-align: left; padding: 9px 12px; border: 1px solid #e5e7eb; vertical-align: top; color: #333; }
table.jp-ref th { background: #f1f5f9; font-weight: 600; }
body.dark-mode table.jp-ref th, body.dark-mode table.jp-ref td { border-color: #404040; color: #e0e0e0; }
body.dark-mode table.jp-ref th { background: #2d2d2d; }

.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 — same look as the other tool pages, plus a dark variant */
.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; }

    .jp-main-content { padding: 15px 10px; }
    .jp-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .jp-textarea { height: 240px; }
    .jp-panel-actions { width: 100%; }
    .jp-panel-actions button { flex: 1 1 auto; }

    .jp-expr-controls { flex-wrap: nowrap; }
    .jp-expr-input { height: 48px; font-size: 16px; }   /* 16px stops iOS zoom-on-focus */
    .jp-expr-controls button { height: 48px; min-width: 72px; }

    /* Minimum 48x48px touch targets */
    button, button.small, button.jp-chip { min-height: 48px; min-width: 48px; }
    .jp-toggle { min-height: 48px; }
    .jp-toggle input { width: 22px; height: 22px; }
    .jp-cheatsheet summary, .faq-question { min-height: 48px; padding: 13px 14px; }
    .faq-question { padding-left: 0; padding-right: 0; }

    .jp-content { padding: 20px 12px 4px; }
    .jp-content h2 { font-size: 20px; }
    .faq-section { padding: 20px 12px 28px; }
    .jp-cheat-grid { grid-template-columns: 1fr; gap: 2px 0; }
    .jp-cheat-grid dd { margin-bottom: 8px; }
    .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; }
}
