:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #cbd5e1;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border: #334155;
    --border-focus: #475569;
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --secondary: #64748b;
    --secondary-hover: #94a3b8;
    --success: #34d399;
    --success-bg: #064e3b;
    --error: #f87171;
    --error-bg: #7f1d1d;
    --warning: #fbbf24;
    --warning-bg: #78350f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-secondary), 0.8);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

.toolbar {
    padding: 1rem 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
}

.editor-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.format-options {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.format-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-options select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.editor-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 400px;
}

.json-editor-container {
    position: relative;
    flex: 1;
    display: flex;
}

.line-numbers {
    padding: 1rem 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5rem;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border);
    min-width: 3rem;
    white-space: pre;
    overflow-y: auto;
}

.json-editor {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    background: var(--bg-primary);
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5rem;
    color: var(--text-primary);
    caret-color: var(--text-primary);
    resize: none;
    tab-size: 4;
    z-index: 2;
    white-space: pre;
    overflow: auto;
}

.json-editor::selection {
    background: rgba(99, 102, 241, 0.3);
    color: transparent;
}

.json-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5rem;
    background: transparent;
    pointer-events: none;
    white-space: pre;
    overflow: auto;
    z-index: 1;
}
    display: none;
.json-highlight code {
    background: transparent;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Prism overrides for our theme */
.token.property {
    color: #82aaff;
}

.token.string {
    color: #c3e88d;
}

.token.boolean,
.token.number {
    color: #f78c6c;
}

.token.null {
    color: #ff5370;
}

.token.punctuation {
    color: var(--text-tertiary);
}

[data-theme="dark"] .token.property {
    color: #82aaff;
}

[data-theme="dark"] .token.string {
    color: #c3e88d;
}

[data-theme="dark"] .token.boolean,
[data-theme="dark"] .token.number {
    color: #f78c6c;
}

[data-theme="dark"] .token.null {
    color: #ff5370;
}

/* When output is readonly, show normal text */
.json-editor[readonly] {
    color: var(--text-primary);
    z-index: 1;
}

.json-highlight.output {
    display: none;
}

.json-editor::placeholder {
    color: var(--text-tertiary);
}

.error-panel, .success-panel {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.error-panel {
    background: var(--error-bg);
    color: var(--error);
}

.success-panel {
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.error-list {
    font-size: 0.875rem;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

.error-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-left: 3px solid var(--error);
}

.error-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error-line {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    color: var(--text-primary);
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.error-preview {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    white-space: pre;
    margin-top: 0.5rem;
}

.error-pointer {
    color: var(--error);
    font-weight: bold;
}

.error-context {
    color: var(--text-secondary);
}

.error-highlight {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
    padding-bottom: 2rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-card svg {
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-color: var(--success);
    background: var(--success-bg);
}

.toast.error {
    border-color: var(--error);
    background: var(--error-bg);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .toolbar {
        flex-direction: column;
    }

    .toolbar-group {
        width: 100%;
        justify-content: center;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* Content sections */
.content-section {
    margin: 4rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.content-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    line-height: 1.7;
}

.content-card h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    text-align: center;
}

.content-card h3 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.25rem;
}

.content-card h4 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.content-card p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.content-card ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content-card li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.json-example {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.json-example code {
    background: transparent;
    padding: 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.benefit {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.benefit:hover {
    transform: translateY(-2px);
}

.benefit h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.benefit p {
    font-size: 0.875rem;
    margin: 0;
}

.faq-section {
    margin: 4rem 0;
}

.faq-content {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.faq-section h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.faq-item {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.faq-item h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.faq-item p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .content-section .content-card {
        padding: 1.5rem;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .faq-section {
        margin: 2rem 0;
        padding: 2rem 0;
    }
    
    .content-card h2 {
        font-size: 1.5rem;
    }
}


/* Logo icon color states */
.logo svg {
    transition: stroke 0.3s ease;
}

/* Footer Styles */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    padding: 2rem 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.footer-left {
    text-align: left;
}

.footer-center {
    text-align: center;
    justify-self: center;
}

.footer-right {
    text-align: right;
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
}

.footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Footer responsive */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        text-align: center;
        justify-self: center;
    }

    .footer-right {
        justify-content: center;
    }
}

/* Contact Page Styles */
.contact-info {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.contact-method {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.contact-method h3 {
    margin-top: 0;
    color: var(--primary);
}

.contact-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background 0.2s ease;
}

.contact-link:hover {
    background: var(--primary-hover);
}

.faq-quick {
    margin: 2rem 0;
}

.faq-item-contact {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.faq-item-contact h4 {
    margin-top: 0;
    color: var(--primary);
}

.contact-cta {
    text-align: center;
    margin: 2rem 0;
}

.logo.validation-default svg {
    stroke: #3357FF;
}

.logo.validation-success svg {
    stroke: #33FF57;
}

.logo.validation-error svg {
    stroke: #FF5733;
}
