* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.header {
    background: linear-gradient(135deg, #2D3748 0%, #4A5568 100%);
    color: white;
    padding: 30px;
    text-align: center;
}
.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #81E6D9, #9F7AEA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}
.controls {
    padding: 30px;
    background: #F7FAFC;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}
.format-tabs {
    display: flex;
    background: #EDF2F7;
    border-radius: 12px;
    padding: 4px;
    margin-right: 20px;
}
.format-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #4A5568;
}
.format-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}
.btn-primary {
    background: linear-gradient(135deg, #48BB78, #38A169);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}
.btn-secondary {
    background: linear-gradient(135deg, #ED8936, #DD6B20);
    color: white;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.4);
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.5);
}
.btn-export {
    background: linear-gradient(135deg, #9F7AEA, #805AD5);
    color: white;
    box-shadow: 0 4px 15px rgba(159, 122, 234, 0.4);
}
.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(159, 122, 234, 0.5);
}
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
}
.input-section, .output-section {
    flex: 1;              /* que cada sección use 50% */
    display: flex;
    flex-direction: column;
}
.section-header {
    padding: 20px 30px;
    background: #EDF2F7;
    font-weight: 600;
    font-size: 16px;
    color: #2D3748;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.input-section .section-header {
    background: linear-gradient(135deg, #FFF5F5, #FED7D7);
}
.output-section .section-header {
    background: linear-gradient(135deg, #F0FFF4, #C6F6D5);
}
.copy-btn {
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #48BB78, #38A169);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    position: relative;
}

.copy-btn svg {
    width: 18px;
    height: 18px;
}
.copy-btn.visible {
    opacity: 1;
    pointer-events: all;
}
.copy-btn::after {
    content: attr(data-label);
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translate(-50%, 8px);
    background: rgba(45, 55, 72, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.copy-btn.visible:hover::after,
.copy-btn.visible:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}
.copy-btn.copied {
    background: linear-gradient(135deg, #9F7AEA, #805AD5);
}
.editor {
    flex: 1;
    border: none;
    padding: 30px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: #FAFAFA;
    max-height: 60vh;
    overflow: auto;
}
.input-editor {
    background: #FFFAFA;
}
.editor-wrapper {
    flex: 1;
    display: flex;
    background: #FFFAFA;
    overflow: hidden;
    max-height: 60vh;
}
.editor-wrapper .input-editor {
    flex: 1;
    height: 100%;
    width: 100%;
}
.line-numbers {
    padding: 30px 12px;
    background: #F1F5F9;
    color: #94A3B8;
    text-align: right;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    user-select: none;
    border-right: 1px solid #E2E8F0;
    min-width: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    overflow: hidden;
    max-height: 60vh;
}
.line-numbers span {
    display: block;
    width: 100%;
}
.line-numbers.is-disabled {
    justify-content: center;
    align-items: center;
    padding: 30px 8px;
    text-align: center;
    font-size: 12px;
    color: #64748B;
}
.line-numbers.is-disabled::after {
    content: attr(data-message);
    white-space: normal;
    line-height: 1.4;
}
.line-numbers.is-disabled span {
    display: none;
}
.output-editor {
    background: #F9FFF9;
   white-space: pre-wrap;   /* o "pre" si no quieres wraps */
    tab-size: 2;
}
.output-editor.is-highlighted {
    white-space: normal;
}
/* Syntax highlighting con colores más vibrantes */
.highlighted-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}
.json-key {
    color: #1E40AF;
    font-weight: bold;
}
.json-string {
    color: #059669;
}
.json-number {
    color: #DC2626;
    font-weight: bold;
}
.json-boolean {
    color: #7C2D12;
    font-weight: bold;
}
.json-null {
    color: #9333EA;
    font-weight: bold;
}
.json-punctuation {
    color: #374151;
    font-weight: bold;
}
.status-bar {
    padding: 15px 30px;
    background: #F7FAFC;
    border-top: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}
.status-valid {
    color: #38A169;
    font-weight: 600;
}
.status-warning {
    color: #B45309;
    font-weight: 600;
}
.status-error {
    color: #E53E3E;
    font-weight: 600;
}
.export-dropdown {
    position: relative;
    display: inline-block;
}
.export-menu {
    display: none;
    position: absolute;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    z-index: 1000;
    top: 100%;
    right: 0;
    margin-top: 5px;
    overflow: hidden;
}
.export-menu.show {
    display: block;
}
.export-option {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: #2D3748;
}
.export-option:hover {
    background: #F7FAFC;
}
.stats {
    display: flex;
    gap: 20px;
    color: #718096;
    font-size: 13px;
}
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .format-tabs {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .resizable-main {
        flex-direction: column;
        min-height: auto;
    }

    .resizable-panel {
        min-width: auto;
        width: 100%;
        max-height: none;
    }

    .input-section,
    .output-section {
        flex: none;
        min-height: 220px;
    }

    .resizer {
        display: none;
    }

    .editor {
        min-height: 200px;
    }
}
.processing {
    opacity: 0.8;
}

/* Estilos para paneles redimensionables */
.resizable-main {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.resizable-panel {
    flex: 1 1 0;
    min-width: 200px;
    overflow: auto;
}

.resizer {
    width: 8px;
    background: #e0e0e0;
    cursor: ew-resize;
    user-select: none;
    transition: background 0.2s;
}
.resizer:hover {
    background: #bdbdbd;
}

/* Estilos para colapsar/expandir nodos JSON */
.json-table {
    display: block;
    width: 100%;
    font-family: monospace;
}
.json-row {
    display: flex;
    align-items: flex-start;
}

.json-linenum {
    flex: 0 0 3em;
    width: 3em;
    color: #bdbdbd;
    text-align: right;
    padding-right: 8px;
    user-select: none;
    background: #f7f7f7;
}

.json-content {
    flex: 1;
}

.json-collapser {
    cursor: pointer;
    user-select: none;
    margin-right: 4px;
    color: #888;
}
.json-block.collapsed {
    display: none;
}
.json-indent {
    margin-left: 24px;
}

.json-collapser:hover {
    color: #000;
}



.faq {
  max-width: 1100px;
  margin: 3rem auto 0;
  border-radius: 12px;
  background-color: #151820;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
  padding: 2.5rem 2rem;
}

.faq h2 {
  margin-bottom: 1.5rem;
  font-size: 1.7rem;
  font-weight: 600;
  text-align: center;
  color: #f0f4ff;
}

.faq-item + .faq-item {
  margin-top: 1rem;
}

.faq-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(69, 91, 255, 0.25), rgba(255, 255, 255, 0.05));
  color: #f5f8ff;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

.faq-icon {
  margin-left: 1rem;
  font-size: 1.4rem;
  transition: transform 0.25s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  color: #c6d4ff;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  padding: 0 1.1rem;
}

.faq-item.open .faq-content {
  max-height: 220px;
  padding-top: 0.8rem;
  opacity: 1;
}
