:root {
    --bg-base: #0F0F2E;
    --bg-panel: #1A1A3C;
    --bg-element: #25254D;
    --bg-hover: #2D2D5B;

    --border-base: #343468;
    --border-highlight: #46468A;

    --text-main: #FFFFFF;
    --text-muted: #94A3B8;

    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --secondary: #818CF8;
    --accent: #10B981;
    /* For "Added" */
    --warning: #F59E0B;
    /* For "Changed" */
    --danger: #EF4444;
    /* For "Fixed/Removed" */

    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --border-glass: 1px solid rgba(255, 255, 255, 0.05);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

svg {
    display: block;
}

.w-4 {
    width: 1rem;
}

.h-4 {
    height: 1rem;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

.w-6 {
    width: 1.5rem;
}

.h-6 {
    height: 1.5rem;
}

.w-full {
    width: 100%;
}

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

.text-muted {
    color: var(--text-muted);
}

/* Layout */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 1.5rem;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .app-container {
        height: auto;
        min-height: 100vh;
    }

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

    .input-panel {
        height: 600px;
    }

    .output-panel {
        height: 600px;
    }
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-glass);
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

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

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-highlight);
    color: var(--text-muted);
}

.btn-outline:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Inputs & Forms */
.settings-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-base);
    background: rgba(0, 0, 0, 0.05);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.setting-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-base {
    width: 100%;
    background: var(--bg-element);
    border: 1px solid var(--border-base);
    color: var(--text-main);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
    color-scheme: dark;
}

.input-base:focus {
    border-color: var(--primary);
}

.textarea-wrapper {
    flex: 1;
    display: flex;
    position: relative;
}

.code-area {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    resize: none;
    border: none;
    background: transparent;
    color: var(--secondary);
    padding: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    outline: none;
    white-space: pre;
    overflow: auto;
}

.code-area.output-area {
    color: var(--text-main);
}

.code-area::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.panel-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-base);
    background: rgba(0, 0, 0, 0.1);
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--bg-element);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
}

.tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--bg-hover);
    color: var(--text-main);
}

/* Output Area */
.output-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view-pane {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    display: flex;
}

.view-pane.active {
    opacity: 1;
    pointer-events: auto;
}

.html-preview {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
}

/* HTML Rendered Styles inside the preview */
.html-preview h1,
.html-preview h2,
.html-preview h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.html-preview h2 {
    font-size: 1.5rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border-base);
    padding-bottom: 0.5rem;
}

.html-preview h3 {
    font-size: 1.125rem;
    margin-top: 1em;
}

.html-preview ul {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.html-preview li {
    margin-bottom: 0.25em;
}

.html-preview code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-element);
    padding: 0.125em 0.375em;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.875rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}