/* Tool Hero Section - Required Styles */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

:root {
    --page-bg: #f8fafc;
    --surface: #ffffff;
    --surface-muted: #fefefe;
    --surface-border: rgba(148, 163, 184, 0.2);
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.12);
    --primary-hover: #1d4ed8;
    --text-strong: #0f172a;
    --text-default: #1e293b;
    --text-muted: #475569;
    --text-soft: #64748b;
    --success: #16a34a;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --danger: #dc2626;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-inner: inset 0 1px 0 rgba(148, 163, 184, 0.12);
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
}

.tool-page {
    padding: clamp(1.25rem, 4vw, 2.5rem) 0;
    color: var(--text-default);
}

.tool-container {
    margin: 0 auto;
}

.layout-grid {
    display: grid;
    gap: clamp(1.25rem, 4vw, 2rem);
}

@media (min-width: 992px) {
    .layout-grid {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

.editor-layout-grid {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    padding: 0 clamp(1.4rem, 4vw, 1.9rem) clamp(1.4rem, 4vw, 1.9rem);
}

@media (min-width: 992px) {
    .editor-layout-grid {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 0;
    }
}

.editor-section {
    display: flex;
    flex-direction: column;
    min-height: clamp(360px, 50vh, 480px);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.result-section {
    display: flex;
    flex-direction: column;
    min-height: clamp(360px, 50vh, 480px);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid rgba(148, 163, 184, 0.2);
}

.panel-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-soft);
}

/* Shared card styles aligned with calculator pages */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--surface-border);
}

.card__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.card__title {
    font-size: clamp(1.45rem, 3vw, 1.8rem);
    font-weight: 700;
    margin: 0;
    color: var(--text-strong);
}

.card__blurb {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.panel-head {
    padding: clamp(1.4rem, 4vw, 1.9rem);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.panel-title {
    font-size: clamp(1.45rem, 3vw, 1.8rem);
    font-weight: 700;
    margin: 0;
    color: var(--text-strong);
}

.panel-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.7rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
}

.editor-toolbar button {
    appearance: none;
    border-radius: 9999px;
    border: 1px solid var(--surface-border);
    background: rgba(37, 99, 235, 0.06);
    color: var(--primary-hover);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.editor-toolbar button:hover,
.editor-toolbar button:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.35);
}

.editor-toolbar button:focus {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.editor-toolbar button:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.editor-toolbar button .icon,
.editor-toolbar button i {
    font-size: 0.95rem;
    line-height: 1;
}

/* Button variants by action */
.editor-toolbar [data-action="beautify"] {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.28);
    color: var(--primary-hover);
}

.editor-toolbar [data-action="minify"] {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-default);
}

.editor-toolbar [data-action="validate"] {
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.28);
    color: #15803d;
}

.editor-toolbar [data-action="copy"] {
    background: rgba(14, 165, 233, 0.10);
    border-color: rgba(14, 165, 233, 0.28);
    color: #0369a1;
}

.editor-toolbar [data-action="reset"] {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.32);
    color: #b45309;
}

.editor-wrapper {
    position: relative;
    flex: 1;
    height: clamp(360px, 50vh, 480px);
    min-height: clamp(360px, 50vh, 480px);
}

#json-editor {
    position: absolute;
    inset: 0;
    border-top-left-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: clamp(360px, 50vh, 480px);
    border-top: 1px solid var(--surface-border);
    border-left: 1px solid var(--surface-border);
}

.editor-footer {
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    border-left: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
    background: #f7f8f8;
    border-bottom-left-radius: var(--radius-md);
}

.editor-meta {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.info-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: clamp(1.6rem, 4vw, 2.2rem);
    display: grid;
    gap: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.info-card ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.75rem;
    color: var(--text-muted);
}

.info-highlight {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.08);
    border: 1px dashed rgba(37, 99, 235, 0.22);
    color: var(--text-default);
}

.result-card {
    border-radius: var(--radius-lg);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.result-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.result-content .result-tree {
    flex: 1;
    min-height: clamp(360px, 50vh, 480px);
}

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(148, 163, 184, 0.25);
    color: var(--text-default);
}

.result-status--default {
    background: rgba(148, 163, 184, 0.25);
    color: var(--text-default);
}

.result-status--success {
    background: rgba(34, 197, 94, 0.18);
    color: #15803d;
}

.result-status--error {
    background: rgba(220, 38, 38, 0.18);
    color: #b91c1c;
}

.result-status--info {
    background: rgba(14, 165, 233, 0.18);
    color: #0369a1;
}

.result-status--warning {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.result-card.is-success {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.result-card.is-error {
    border-color: rgba(220, 38, 38, 0.45);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.result-card.is-info {
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.result-card.is-warning {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.result-tree {
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    border-radius:0 var(--radius-md) var(--radius-md) 0;
    padding: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    overflow: auto;
    min-height: clamp(360px, 50vh, 480px);
}

.tree-node {
    position: relative;
    padding-left: 1.25rem;
}

.tree-node::before {
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 0.65rem;
    width: 0.6rem;
    height: 1px;
    background: rgba(148, 163, 184, 0.45);
}

.tree-root::before {
    display: none;
}

.tree-header,
.tree-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.15rem 0;
}

.tree-line {
    color: rgba(226, 232, 240, 0.92);
}

.tree-summary {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.75);
}

.tree-toggle {
    background: none;
    border: none;
    color: rgba(226, 232, 240, 0.95);
    font: inherit;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 1rem;
    text-align: center;
}

.tree-toggle:focus {
    outline: 2px solid rgba(56, 189, 248, 0.6);
    outline-offset: 2px;
}

.tree-toggle-disabled {
    cursor: default;
    color: rgba(148, 163, 184, 0.45);
}

.tree-children {
    margin-left: 1.25rem;
    border-left: 1px solid rgba(148, 163, 184, 0.28);
    padding-left: 1rem;
    margin-top: 0.35rem;
}

.tree-node.is-collapsed > .tree-children {
    display: none;
}

.tree-node.is-collapsed > .tree-header .tree-toggle {
    transform: rotate(-90deg);
}

.tree-empty {
    color: rgba(148, 163, 184, 0.65);
    font-style: italic;
}

.tree-key {
    color: #facc15;
}

.tree-value-string {
    color: #22d3ee;
}

.tree-value-number {
    color: #f472b6;
}

.tree-value-boolean {
    color: #34d399;
}

.tree-value-null {
    color: #f97316;
}

.tree-brace {
    color: rgba(248, 250, 252, 0.8);
}

.tree-line-close {
    margin-top: 0.3rem;
}

.tree-primitive {
    color: rgba(148, 163, 184, 0.85);
}

.section-title {
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 1.5rem;
}

.feature-table {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.feature-table th,
.feature-table td {
    padding: clamp(0.85rem, 2vw, 1.1rem) clamp(1.1rem, 3vw, 1.5rem);
}

.feature-table tbody tr:nth-child(every) {
    background: rgba(248, 250, 252, 0.65);
}

.faq-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: clamp(1.8rem, 4vw, 2.4rem);
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-soft);
}

.faq-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

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

.faq-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(37, 99, 235, 0.12);
    color: var(--primary-hover);
}

.faq-question {
    margin: 0 0 0.45rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
}

.faq-answer {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.input-group__title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-strong);
}

@media (max-width: 768px) {
    .editor-toolbar {
        gap: 0.5rem;
        padding: 0.9rem 1rem;
    }

    .editor-toolbar button {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

.education-section {
    margin-top: clamp(1.5rem, 6vw, 2.5rem);
    display: grid;
    gap: clamp(2rem, 6vw, 3rem);
}

.education-article {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: clamp(1.8rem, 4vw, 2.4rem);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 0.9rem;
}

.education-article h2,
.education-article h3 {
    color: var(--text-strong);
    font-weight: 700;
}

.education-article p {
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.education-article ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-muted);
    display: grid;
    gap: 0.45rem;
}

.education-highlight {
    background: rgba(37, 99, 235, 0.08);
    border: 1px dashed rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    color: var(--text-default);
}

.education-resources {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.18);
    padding: clamp(1.6rem, 4vw, 2.1rem);
    box-shadow: var(--shadow-soft);
}

.education-resources__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-strong);
}

.education-resources__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.education-resources__list a {
    color: var(--primary-hover);
    font-weight: 600;
    text-decoration: none;
}

.education-resources__list a:hover {
    text-decoration: underline;
}

/* Related tools card styling to match calculator pages */
.related-tools {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.22);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
}

.related-tools__title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-strong);
}

.related-tools__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: start;
}

@media (min-width: 768px) {
    .related-tools__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.related-tools__list a {
    color: var(--primary-hover);
    font-weight: 600;
    text-decoration: none;
}

.related-tools__list a:hover {
    text-decoration: underline;
}
.related-tools-section{
    margin-top: 2rem;
}