:root {
    /* Color Palette - Ocean Blue Theme */
    --primary: #0984E3;
    --primary-hover: #74B9FF;
    --secondary: #74B9FF;
    --accent: #E17055;
    --accent-hover: #D63031;
    --accent-light: rgba(225, 112, 85, 0.1);
    
    --bg-base: #0D1B2A;
    --bg-surface: #1B263B;
    --bg-surface-hover: #415A77;
    --border: #415A77;
    
    --text-main: #E0E1DD;
    --text-muted: #778DA9;
    
    --success: #00B894;
    --success-light: rgba(0, 184, 148, 0.1);
    --warning: #FDCB6E;
    --warning-light: rgba(253, 203, 110, 0.1);
    --danger: #D63031;
    --danger-light: rgba(214, 48, 49, 0.1);
    
    /* Layout */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

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

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.col-span-2 { grid-column: span 2 / span 2; }
.hidden { display: none !important; }

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.bg-accent-light { background-color: var(--accent-light); }

/* Glassmorphism */
.glassmorphism {
    background: rgba(27, 38, 59, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    border-bottom: 1px solid var(--border);
    background: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

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

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex-grow: 1;
}

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

@media (min-width: 1024px) {
    .layout-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Input Section */
.input-section {
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
}

.section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

/* Editor */
.editor-container {
    display: flex;
    flex-grow: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.1);
}

.line-numbers {
    padding: 1rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    text-align: right;
    min-width: 2.5rem;
    user-select: none;
    line-height: 1.5;
}

.commit-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1rem;
    resize: none;
    outline: none;
}

.commit-input::placeholder {
    color: rgba(119, 141, 169, 0.5);
}

.input-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.format-hint code {
    font-family: var(--font-mono);
    background: rgba(119, 141, 169, 0.2);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    color: var(--secondary);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge.default { background: var(--border); color: var(--text-muted); }
.badge.valid { background: var(--success-light); color: var(--success); }
.badge.warning { background: var(--warning-light); color: var(--warning); }
.badge.error { background: var(--danger-light); color: var(--danger); }

/* Panels */
.panel {
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.panel-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.panel-body {
    padding: 1.25rem;
}

/* Structure Grid */
.structure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.structure-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.node-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.node-value {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    word-break: break-all;
    white-space: pre-wrap;
}
.node-value.valid { color: var(--text-main); }

/* Validation List */
.validation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.validation-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    align-items: flex-start;
}

.validation-item .icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.validation-item.default {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
}

.validation-item.pass {
    background: var(--success-light);
    color: var(--success);
}
.validation-item.pass .content { color: var(--text-main); }

.validation-item.warn {
    background: var(--warning-light);
    color: var(--warning);
}

.validation-item.error {
    background: var(--danger-light);
    color: var(--danger);
}

/* Suggestion Box */
.suggestion-code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-main);
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--accent);
    white-space: pre-wrap;
    word-break: break-all;
}

/* Types Grid */
.types-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.type-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-main);
    cursor: default;
    transition: all 0.2s;
}

.type-tag:hover {
    border-color: var(--primary);
    background: var(--bg-surface-hover);
}

.type-tag .desc {
    color: var(--text-muted);
    font-family: var(--font-sans);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

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

.btn-outline:hover:not(:disabled) {
    background-color: var(--bg-surface-hover);
}

.btn-accent {
    background-color: var(--accent);
    color: white;
}
.btn-accent:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

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