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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    --json-key: #0066cc;
    --json-string: #008000;
    --json-number: #ff6600;
    --json-boolean: #0000ff;
    --json-null: #808080;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.title-icon {
    font-size: 3.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.95;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tool-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--light-bg);
    border-color: var(--text-secondary);
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.editor-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

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

.editor-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.json-editor {
    width: 100%;
    min-height: 400px;
    max-height: 800px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    background: #fafafa;
    color: var(--text-primary);
    transition: border-color 0.3s ease;
    overflow-x: auto;
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
}

.json-editor:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.json-output {
    width: 100%;
    min-height: 400px;
    max-height: 800px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    overflow-y: auto;
    margin: 0;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
}

.json-output code {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Minified mode - allow horizontal scroll for very long lines */
.json-output.minified-mode {
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
}

.json-output.minified-mode code {
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
}

/* JSON Syntax Highlighting */
.json-key {
    color: var(--json-key);
}

.json-string {
    color: var(--json-string);
}

.json-number {
    color: var(--json-number);
}

.json-boolean {
    color: var(--json-boolean);
}

.json-null {
    color: var(--json-null);
}

.json-punctuation {
    color: #d4d4d4;
}

/* Tree View */
.tree-view {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--light-bg);
    max-height: 500px;
    overflow-y: auto;
}

.tree-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.tree-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.tree-node {
    margin-left: 20px;
    padding: 5px 0;
}

.tree-key {
    color: var(--json-key);
    font-weight: 600;
}

.tree-value {
    color: var(--text-primary);
}

.tree-string {
    color: var(--json-string);
}

.tree-number {
    color: var(--json-number);
}

.tree-boolean {
    color: var(--json-boolean);
}

.tree-null {
    color: var(--json-null);
}

.tree-toggle {
    cursor: pointer;
    user-select: none;
    margin-right: 5px;
    color: var(--text-secondary);
}

.tree-toggle:hover {
    color: var(--text-primary);
}

/* Error Display */
.error-display {
    margin-top: 20px;
    padding: 15px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    border-left: 5px solid #f00;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.error-icon {
    font-size: 1.2rem;
}

.error-title {
    font-weight: 600;
    color: #c00;
    flex: 1;
}

.error-message {
    color: #800;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

/* Validation Results */
.validation-results {
    margin-top: 20px;
    padding: 15px;
    background: #efe;
    border: 2px solid #cfc;
    border-radius: 8px;
    border-left: 5px solid #0a0;
}

.validation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.validation-icon {
    font-size: 1.2rem;
}

.validation-title {
    font-weight: 600;
    color: #0a0;
    flex: 1;
}

.validation-content {
    color: #060;
    font-size: 0.95rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* Features Section */
.features-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 25px;
    background: var(--light-bg);
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

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

.faq-item {
    padding: 20px;
    background: var(--light-bg);
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Recent Queries Section */
.recent-queries-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.recent-queries-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.recent-queries-icon {
    font-size: 1.2rem;
}

.recent-queries-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-query-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.recent-query-item:hover {
    background: #f0f0f0;
    border-color: #667eea;
    transform: translateX(5px);
}

.recent-query-content {
    flex: 1;
    min-width: 0;
}

.recent-query-preview {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-query-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.recent-query-action {
    text-transform: capitalize;
    font-weight: 500;
}

.recent-query-actions {
    display: flex;
    gap: 8px;
}

.recent-query-btn,
.recent-query-delete-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: var(--light-bg);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.recent-query-btn:hover {
    background: #667eea;
    color: white;
    transform: rotate(90deg);
}

.recent-query-delete-btn:hover {
    background: #f5576c;
    color: white;
}

/* Floating Navigation */
.floating-nav {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 200px;
    display: none;
}

@media (min-width: 1024px) {
    .floating-nav {
        display: block;
    }
}

.floating-nav-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-title {
    font-size: 0.95rem;
}

.floating-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.floating-nav-list li {
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--light-bg);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 500;
}

/* About Section */
.about-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 30px;
}

.about-content {
    line-height: 1.8;
    color: var(--text-primary);
}

.about-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 25px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.about-content ul {
    margin: 15px 0;
    padding-left: 25px;
}

.about-content li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.about-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Feedback Section */
.feedback-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 30px;
}

.feedback-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1rem;
}

.feedback-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.label-icon {
    font-size: 1.1rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
    background: var(--light-bg);
    color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.feedback-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.feedback-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.feedback-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}

.feedback-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    margin-top: 40px;
}

.footer-links {
    margin-top: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .json-editor,
    .json-output {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .title-icon {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .tool-card,
    .features-section,
    .faq-section {
        padding: 20px;
    }
    
    .toolbar {
        justify-content: center;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .json-editor,
    .json-output {
        min-height: 250px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

