/* JSON to HTML Converter Styles */
:root {
    --html-primary: #e34c26;
    --html-primary-dark: #b83d1e;
    --html-primary-light: #fef5f3;
    --html-accent: #f06529;
    --html-surface: #ffffff;
    --html-surface-alt: #f8fafc;
    --html-border: #e2e8f0;
    --html-border-focus: #e34c26;
    --html-text: #0f172a;
    --html-text-muted: #64748b;
    --html-success: #10b981;
    --html-error: #ef4444;
    --html-warning: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.html-converter-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.converter-wrapper {
    width: 100%;
}

.converter-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.input-panel,
.output-panel {
    display: flex;
    flex-direction: column;
    background: var(--html-surface);
    border: 1px solid var(--html-border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.input-panel:focus-within,
.output-panel:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--html-border-focus);
}

.panel-header {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--html-surface-alt);
    border-bottom: 1px solid var(--html-border);
    gap: 0.75rem;
}

.panel-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--html-text);
    margin: 0;
    line-height: 1.4;
}

.panel-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    background: var(--html-surface);
    color: var(--html-text-muted);
    border: 1px solid var(--html-border);
    white-space: nowrap;
}

.panel-badge-success {
    background: #ecfdf5;
    color: var(--html-success);
    border-color: #a7f3d0;
}

.panel-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--html-surface-alt);
    padding: 0.25rem;
    border-radius: 8px;
    width: 100%;
    justify-content: flex-start;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--html-text-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--html-text);
    background: var(--html-surface);
}

.tab-btn.active {
    color: var(--html-primary);
    background: var(--html-surface);
    box-shadow: var(--shadow-sm);
}

.tab-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--html-text);
    background: var(--html-surface);
    border: 1px solid var(--html-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-action:hover {
    background: var(--html-surface-alt);
    border-color: var(--html-border-focus);
    color: var(--html-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-action:active {
    transform: translateY(0);
}

.btn-action:focus-visible {
    outline: 2px solid var(--html-primary);
    outline-offset: 2px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: #ecfdf5;
    border-color: var(--html-success);
    color: var(--html-success);
}

.btn-download:hover {
    background: var(--html-primary-light);
    border-color: var(--html-primary);
    color: var(--html-primary);
}

.panel-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.tab-content {
    display: none;
    flex: 1;
    min-height: 500px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.editor-box {
    flex: 1;
    min-height: 500px;
    position: relative;
    background: var(--html-surface);
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.preview-box {
    flex: 1;
    min-height: 500px;
    position: relative;
    background: var(--html-surface);
    border: 1px solid var(--html-border);
    border-radius: 8px;
    overflow: hidden;
}

.html-preview {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    background: var(--html-surface);
}

.panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--html-surface-alt);
    border-top: 1px solid var(--html-border);
    font-size: 0.875rem;
}

.editor-status {
    color: var(--html-text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--html-text-muted);
    display: inline-block;
}

.editor-status.success::before {
    background: var(--html-success);
}

.editor-status.error::before {
    background: var(--html-error);
}

.editor-status.warning::before {
    background: var(--html-warning);
}

/* ACE Editor Customization */
.ace_editor {
    font-size: 14px;
    line-height: 1.6;
}

.ace_gutter {
    background: var(--html-surface-alt) !important;
    border-right: 1px solid var(--html-border) !important;
}

.ace_scroller {
    background: var(--html-surface) !important;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .converter-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .panel-header-row {
        flex-wrap: wrap;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .html-converter-section {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .converter-layout {
        gap: 1rem;
    }

    .panel-header {
        padding: 0.875rem 1rem;
    }

    .panel-title {
        font-size: 1rem;
    }

    .btn-action {
        padding: 0.4375rem 0.75rem;
        font-size: 0.8125rem;
    }

    .btn-action span:not(.btn-icon) {
        display: none;
    }

    .btn-action {
        padding: 0.5rem;
        min-width: 36px;
        justify-content: center;
    }

    .panel-content {
        min-height: 300px;
    }

    .tab-content {
        min-height: 300px;
    }

    .editor-box {
        min-height: 300px;
    }

    .code-editor {
        min-height: 300px;
    }

    .preview-box {
        min-height: 300px;
    }

    .html-preview {
        min-height: 300px;
    }

    .panel-footer {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .panel-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .panel-actions {
        gap: 0.375rem;
    }

    .panel-content {
        min-height: 250px;
    }

    .tab-content {
        min-height: 250px;
    }

    .editor-box {
        min-height: 250px;
    }

    .code-editor {
        min-height: 250px;
    }

    .preview-box {
        min-height: 250px;
    }

    .html-preview {
        min-height: 250px;
    }

    .panel-tabs {
        width: 100%;
    }

    .panel-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .panel-title-group {
        width: 100%;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    :root {
        --html-surface: #1e293b;
        --html-surface-alt: #0f172a;
        --html-border: #334155;
        --html-text: #f1f5f9;
        --html-text-muted: #94a3b8;
    }
}
