/* Reset y variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0056A6;
    --secondary: #FFB800;
    --accent: #00D1B2;
    --text: #333333;
    --background: #FFFFFF;
    --primary-hover: #004085;
    --secondary-hover: #e6a600;
    --accent-hover: #00b8a0;
    --text-secondary: #666666;
    --border: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Contenido principal */
.main-content {
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-header h2 i {
    color: var(--primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Editor de JSON */
.editor-section {
    background: var(--background);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.editor-container {
    width: 100%;
}

/* Campo de entrada de empresa */
.empresa-input {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.empresa-input label {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.empresa-input input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.empresa-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 86, 166, 0.1);
}

.empresa-input input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.editor-header label {
    font-weight: 600;
    color: var(--text);
    font-size: 1.1rem;
}

.editor-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Editor de texto */
#jsonEditor {
    width: 100%;
    min-height: 400px;
    padding: 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
    background: #fafafa;
    color: var(--text);
}

#jsonEditor:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 86, 166, 0.1);
    background: white;
}

#jsonEditor::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Estado de validación */
.validation-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}

.validation-status.valid {
    background: rgba(0, 209, 178, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.validation-status.invalid {
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.validation-status.neutral {
    background: rgba(102, 102, 102, 0.1);
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
}

.status-message {
    font-weight: 500;
    margin: 0;
}

/* Notificaciones */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: var(--background);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.notification.success {
    border-left-color: var(--accent);
}

.notification.error {
    border-left-color: var(--secondary);
}

.notification.warning {
    border-left-color: var(--secondary);
}

/* Estados de carga */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .editor-section {
        padding: 1.5rem;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .editor-controls {
        justify-content: center;
    }
    
    .btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .editor-section {
        padding: 1rem;
    }
    
    .empresa-input {
        padding: 0.75rem;
    }
    
    #jsonEditor {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .editor-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
}
