:root {
    /* Arctic Blue Palette */
    --primary: #3B82F6;
    /* Blue */
    --primary-hover: #2563EB;
    --secondary: #93C5FD;
    /* Light Blue */
    --accent: #10B981;
    /* Emerald Green */
    --accent-hover: #059669;
    --background: #0B1426;
    /* Deep Blue Dark */
    --surface: #1E293B;
    /* Slate Blue */

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    --glass-bg: rgba(30, 41, 59, 0.65);
    --glass-border: rgba(147, 197, 253, 0.15);

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

    --radius: 12px;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 2rem;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05), transparent 40%);
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-main {
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 2rem;
    align-items: stretch;
    min-height: calc(100vh - 160px);
}

.col-inputs,
.col-visuals {
    display: flex;
    flex-direction: column;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

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

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

h4 {
    font-size: 1.05rem;
    font-weight: 500;
    color: #E2E8F0;
}

/* Utilities */
.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
}

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

.text-error {
    color: var(--error) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

.font-mono {
    font-family: 'Fira Code', monospace;
}

.relative {
    position: relative;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Forms & Editor */
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(147, 197, 253, 0.1);
    color: var(--text-main);
    border-radius: 8px;
    outline: none;
    transition: 0.2s;
    font-size: 0.95rem;
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.code-wrapper {
    position: relative;
    border-radius: 8px;
    border: 1px solid rgba(147, 197, 253, 0.1);
    overflow: hidden;
    background: #0f172a;
}

.code-input {
    width: 100%;
    height: 100%;
    min-height: 250px;
    background: transparent;
    border: none;
    color: #38bdf8;
    /* TS blue-ish syntax color substitute */
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
}

.code-input:focus {
    border: none;
    box-shadow: none;
    outline: none;
}

.badge {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-left: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.small {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.outline-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.outline-btn:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

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

.icon-btn:hover {
    color: #fff;
}

/* Visualizer */
.viz-panel {
    min-height: 400px;
}

.graph-wrapper {
    position: relative;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(147, 197, 253, 0.1);
    overflow: hidden;
}

#graph-network {
    width: 100%;
    height: 100%;
    outline: none;
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s;
}

.empty-state.hidden {
    opacity: 0;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Details */
.detail-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.detail-value.border-left {
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 0 4px 4px 0;
}

/* Compat Checking Result */
.compat-result {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.compat-result.success {
    border-left: 3px solid var(--success);
}

.compat-result.error {
    border-left: 3px solid var(--error);
}

.compat-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

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

    .col-visuals {
        min-height: 500px;
    }
}