/* Import Google Fonts - Inter for modern typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* === LEGACY VARIABLES (maintained for backward compatibility) === */
    --primary-blue: #007bff;
    --secondary-blue: #17a2b8;
    --dark-gray: #343a40;
    --light-gray: #f8f9fa;
    --white: #ffffff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;

    /* === BACKGROUND GRADIENTS === */
    /* Dark gradient backgrounds for sophisticated look */
    --bg-primary-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-secondary-gradient: linear-gradient(135deg, #2c2c54 0%, #40407a 100%);
    --bg-accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* === PANEL COLORS === */
    /* Background colors for cards, panels, and surfaces */
    --panel-primary: #1e1e2e;         /* Main panel background */
    --panel-secondary: #262640;       /* Secondary panel background */
    --panel-tertiary: #2a2a42;        /* Tertiary panel background */
    --panel-elevated: #323252;        /* Elevated/hover panel background */
    --panel-glass: rgba(30, 30, 46, 0.8); /* Glass-like panel with transparency */
    
    /* === BORDER COLORS === */
    --border-primary: #3a3a5c;        /* Primary border color */
    --border-secondary: #4a4a6c;      /* Secondary border color */
    --border-accent: #667eea;         /* Accent border color */
    --border-muted: #2a2a42;          /* Muted border color */
    
    /* === TEXT COLORS === */
    /* Text colors for various contexts */
    --text-primary: #ffffff;          /* Primary text - white */
    --text-secondary: #b4b4c8;        /* Secondary text - light gray */
    --text-muted: #8a8aa0;           /* Muted text - medium gray */
    --text-disabled: #666680;        /* Disabled text - dark gray */
    --text-accent: #667eea;          /* Accent text - brand blue */
    --text-link: #764ba2;            /* Link text - purple */
    --text-link-hover: #9575cd;      /* Link hover text - lighter purple */
    
    /* === BRAND ACCENT COLORS === */
    /* Primary brand colors */
    --brand-primary: #667eea;         /* Primary brand color - blue */
    --brand-secondary: #764ba2;       /* Secondary brand color - purple */
    --brand-tertiary: #f093fb;       /* Tertiary brand color - pink */
    --brand-quaternary: #4facfe;     /* Quaternary brand color - cyan */
    
    /* === UI STATE COLORS === */
    /* Colors for various UI states */
    --state-success: #4ade80;         /* Success state - green */
    --state-success-bg: rgba(74, 222, 128, 0.1); /* Success background */
    --state-warning: #facc15;         /* Warning state - yellow */
    --state-warning-bg: rgba(250, 204, 21, 0.1); /* Warning background */
    --state-error: #ef4444;          /* Error state - red */
    --state-error-bg: rgba(239, 68, 68, 0.1); /* Error background */
    --state-info: #3b82f6;           /* Info state - blue */
    --state-info-bg: rgba(59, 130, 246, 0.1); /* Info background */
    
    /* === INTERACTIVE COLORS === */
    /* Colors for interactive elements */
    --interactive-primary: #667eea;   /* Primary interactive color */
    --interactive-primary-hover: #5a6fd8; /* Primary hover state */
    --interactive-primary-active: #4c5bc5; /* Primary active state */
    --interactive-secondary: #764ba2; /* Secondary interactive color */
    --interactive-secondary-hover: #684190; /* Secondary hover state */
    --interactive-secondary-active: #5a377e; /* Secondary active state */
    
    /* === SHADOW COLORS === */
    /* Shadows for depth and elevation */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    /* === SPACING SCALE === */
    /* Consistent spacing values */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-xxl: 3rem;      /* 48px */
    
    /* === BORDER RADIUS === */
    /* Consistent border radius values */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-full: 9999px;  /* Fully rounded */
    
    /* === TYPOGRAPHY SCALE === */
    /* Font sizes and weights */
    --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-md: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* === TRANSITION VALUES === */
    /* Consistent transition timings */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* === GLOBAL RESETS AND BASE STYLES === */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary);
    background: var(--bg-primary-gradient);
    color: var(--text-primary);
    font-size: var(--font-size-md);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

/* Reset default margins and paddings */
h1, h2, h3, h4, h5, h6, p, ul, ol, li, blockquote, figure, figcaption {
    margin: 0;
    padding: 0;
}

/* Typography Base Styles */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: 1.2;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-sm); }

p {
    color: var(--text-secondary);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--text-link-hover);
}

/* === LEGACY SPLIT.JS STYLES (maintained for backward compatibility) === */
.gutter.gutter-horizontal {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
    cursor: col-resize;
    background-color: var(--border-primary);
    background-repeat: no-repeat;
    background-position: center;
    width: 5px;
    border-left: 1px solid var(--border-secondary);
    border-right: 1px solid var(--border-secondary);
    transition: background-color var(--transition-fast);
}

.gutter.gutter-horizontal:hover {
    background-color: var(--interactive-primary);
}

/* === LEGACY LAYOUT STYLES (updated with new variables) === */
.main-container {
    height: 100vh;
    background: var(--bg-primary-gradient);
}

.column-header {
    background-color: var(--panel-secondary);
    color: var(--text-primary);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

.column-footer {
    background-color: var(--panel-secondary);
    color: var(--text-primary);
    padding: var(--space-md);
    border-top: 1px solid var(--border-primary);
}

.column-body {
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--panel-primary);
}

/* === GRID LAYOUT SYSTEM === */
/* Modern grid-based layout replacing legacy container system */

.app {
    display: grid;
    grid-template-areas:
        "sidebar topbar"
        "sidebar content";
    grid-template-columns: minmax(200px, 1fr) auto;
    grid-template-rows: auto 1fr;
    height: 100vh;
    width: 100vw;
    background: var(--bg-primary-gradient);
    overflow: hidden;
}

.sidebar {
    grid-area: sidebar;
    min-width: 200px;
    max-width: 500px;
    min-height: 100vh;
    background: var(--panel-primary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.topbar {
    grid-area: topbar;
    background: var(--panel-tertiary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    min-height: 64px;
    box-shadow: var(--shadow-sm);
    z-index: 50;
}

.content {
    grid-area: content;
    background: var(--panel-primary);
    overflow: auto;
    position: relative;
    padding: var(--space-lg);
    min-height: 0; /* Important for grid overflow */
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .app {
        grid-template-areas:
            "topbar"
            "content";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .sidebar {
        position: fixed;
        top: 64px;
        left: -280px;
        height: calc(100vh - 64px);
        transition: left var(--transition-normal);
        z-index: 200;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .content {
        padding: var(--space-md);
    }
}

/* Grid container utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
}

/* Flexible layout utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.flex-1 { flex: 1; }
.flex-none { flex: none; }
.flex-auto { flex: auto; }

/* Gap utilities */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-xxl { gap: var(--space-xxl); }

/* === CORE COMPONENTS === */
/* Brand/Logo Component */
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--space-md);
}

.brand:hover {
    color: var(--brand-primary);
    transition: color var(--transition-fast);
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--bg-accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: var(--font-weight-bold);
}

.brand-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

/* Button Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1;
    user-select: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--interactive-primary);
}

/* Button variants */
.btn-primary {
    background: var(--interactive-primary);
    color: var(--text-primary);
    border-color: var(--interactive-primary);
}

.btn-primary:hover {
    background: var(--interactive-primary-hover);
    border-color: var(--interactive-primary-hover);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    background: var(--interactive-primary-active);
    border-color: var(--interactive-primary-active);
}

.btn-secondary {
    background: var(--interactive-secondary);
    color: var(--text-primary);
    border-color: var(--interactive-secondary);
}

.btn-secondary:hover {
    background: var(--interactive-secondary-hover);
    border-color: var(--interactive-secondary-hover);
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-secondary);
}

.btn-ghost:hover {
    background: var(--panel-elevated);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.btn-outline {
    background: transparent;
    color: var(--interactive-primary);
    border-color: var(--interactive-primary);
}

.btn-outline:hover {
    background: var(--interactive-primary);
    color: var(--text-primary);
}

/* Button sizes */
.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-md);
}

.btn-full {
    width: 100%;
}

.btn-icon {
    padding: var(--space-sm);
    width: 36px;
    height: 36px;
}

/* Navigation Component */
.nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
}

.nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    position: relative;
}

.nav a:hover {
    background: var(--panel-elevated);
    color: var(--text-primary);
}

.nav a.active {
    background: var(--interactive-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--brand-tertiary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    background: var(--state-error);
    color: var(--text-primary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    min-width: 20px;
    text-align: center;
}

/* Search Component */
.search {
    position: relative;
    margin-bottom: var(--space-md);
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 40px;
    background: var(--panel-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--interactive-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: var(--panel-primary);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Accordion Component */
.accordion {
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--panel-secondary);
}

.accordion-item {
    border-bottom: 1px solid var(--border-primary);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.accordion-header:hover {
    background: var(--panel-elevated);
}

.accordion-header[aria-expanded="true"] {
    background: var(--panel-elevated);
}

.accordion-icon {
    transition: transform var(--transition-fast);
    width: 16px;
    height: 16px;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 var(--space-lg) var(--space-md);
    color: var(--text-secondary);
    line-height: 1.6;
}

.accordion-content[hidden] {
    display: none;
}

/* === CONTENT SECTION STYLES === */
/* Section Component */
.section {
    margin-bottom: var(--space-xs);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.section-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.section-actions {
    display: flex;
    gap: var(--space-sm);
}

.section-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Card Component */
.card {
    background: var(--panel-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-muted);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.card-actions {
    display: flex;
    gap: var(--space-xs);
}

.card-body {
    color: var(--text-secondary);
    line-height: 1.6;
    padding:0px;
}

.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Card variants */
.card-elevated {
    background: var(--panel-tertiary);
    box-shadow: var(--shadow-md);
}

.card-glass {
    background: var(--panel-glass);
    backdrop-filter: blur(10px);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-outlined {
    background: transparent;
    border-color: var(--border-accent);
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Diff Component */
.diff {
    background: var(--panel-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
}

.diff-header {
    background: var(--panel-elevated);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-primary);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.diff-content {
    max-height: 400px;
    overflow-y: auto;
}

.diff-line {
    display: flex;
    padding: var(--space-xs) var(--space-md);
    line-height: 1.4;
}

.diff-line-number {
    width: 60px;
    color: var(--text-muted);
    text-align: right;
    margin-right: var(--space-md);
    user-select: none;
}

.diff-line-content {
    flex: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-line-added {
    background: var(--state-success-bg);
    color: var(--state-success);
}

.diff-line-removed {
    background: var(--state-error-bg);
    color: var(--state-error);
}

.diff-line-modified {
    background: var(--state-warning-bg);
    color: var(--state-warning);
}

/* Chips Component */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--panel-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.chip:hover {
    background: var(--panel-tertiary);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.chip-removable {
    cursor: pointer;
}

.chip-remove {
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip-remove:hover {
    background: var(--state-error);
    color: var(--text-primary);
}

/* Chip variants */
.chip-primary {
    background: var(--interactive-primary);
    color: var(--text-primary);
    border-color: var(--interactive-primary);
}

.chip-success {
    background: var(--state-success-bg);
    color: var(--state-success);
    border-color: var(--state-success);
}

.chip-warning {
    background: var(--state-warning-bg);
    color: var(--state-warning);
    border-color: var(--state-warning);
}

.chip-error {
    background: var(--state-error-bg);
    color: var(--state-error);
    border-color: var(--state-error);
}

/* Link Component */
.link {
    color: var(--text-link);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition-fast);
}

.link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.link-primary {
    color: var(--brand-primary);
}

.link-primary:hover {
    color: var(--interactive-primary-hover);
}

.link-secondary {
    color: var(--text-secondary);
}

.link-secondary:hover {
    color: var(--text-primary);
}

.link-external::after {
    content: '↗';
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

.link-icon {
    width: 16px;
    height: 16px;
}

/* Field Components */
.field {
    margin-bottom: var(--space-md);
}

.field-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.field-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--panel-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.field-input::placeholder {
    color: var(--text-muted);
}

.field-input:focus {
    outline: none;
    border-color: var(--interactive-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: var(--panel-primary);
}

.field-error {
    border-color: var(--state-error);
}

.field-error:focus {
    border-color: var(--state-error);
    box-shadow: 0 0 0 2px var(--state-error-bg);
}

.field-help {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.field-error-text {
    font-size: var(--font-size-xs);
    color: var(--state-error);
    margin-top: var(--space-xs);
}

/* Hash/Tag Component */
.hash {
    font-family: 'Courier New', monospace;
    background: var(--panel-tertiary);
    color: var(--text-accent);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border: 1px solid var(--border-primary);
}

/* Grouping Component */
.grouping {
    background: var(--panel-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.grouping-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-muted);
}

.grouping-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.grouping-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* === CHAT INTERFACE COMPONENTS === */
/* Chat Container */
.chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--panel-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chat-header {
    background: var(--panel-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.chat-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.chat-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--state-success);
}

.chat-status-indicator.offline {
    background: var(--text-muted);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-height: 0; /* Important for flex overflow */
}

/* Message Components */
.msg {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    max-width: 100%;
}

.msg-user {
    flex-direction: row-reverse;
}

.msg-user .bubble {
    background: var(--interactive-primary);
    color: var(--text-primary);
    margin-left: var(--space-xl);
    margin-right: 0;
}

.msg-assistant .bubble {
    background: var(--panel-secondary);
    color: var(--text-secondary);
    margin-right: var(--space-xl);
    margin-left: 0;
    border: 1px solid var(--border-primary);
}

.msg-system {
    justify-content: center;
    margin: var(--space-md) 0;
}

.msg-system .bubble {
    background: var(--panel-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-muted);
    font-size: var(--font-size-sm);
    padding: var(--space-xs) var(--space-md);
    text-align: center;
    max-width: 300px;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    margin-top: var(--space-xs);
}

.msg-user .msg-avatar {
    background: var(--interactive-primary);
}

.msg-assistant .msg-avatar {
    background: var(--panel-elevated);
    border: 1px solid var(--border-primary);
    color: var(--text-accent);
}

/* Message Bubble */
.bubble {
    background: var(--panel-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    position: relative;
    word-wrap: break-word;
    line-height: 1.5;
    max-width: 70%;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.bubble:hover {
    box-shadow: var(--shadow-md);
}

.bubble-content {
    margin: 0;
}

.bubble-content p {
    margin: 0 0 var(--space-sm);
}

.bubble-content p:last-child {
    margin-bottom: 0;
}

.bubble-content pre {
    background: var(--panel-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
    margin: var(--space-sm) 0;
}

.bubble-content code {
    background: var(--panel-tertiary);
    color: var(--text-accent);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-sm);
}

.bubble-timestamp {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
    text-align: right;
}

.msg-user .bubble-timestamp {
    text-align: left;
}

/* Input Bar */
.inputbar {
    background: var(--panel-secondary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    min-height: 80px;
}

.inputbar-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.inputbar-input {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    padding: var(--space-sm) var(--space-md);
    background: var(--panel-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    resize: none;
    transition: all var(--transition-fast);
    font-family: var(--font-family-primary);
}

.inputbar-input::placeholder {
    color: var(--text-muted);
}

.inputbar-input:focus {
    outline: none;
    border-color: var(--interactive-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: var(--panel-primary);
}

.inputbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.inputbar-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--interactive-primary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.inputbar-send:hover {
    background: var(--interactive-primary-hover);
    box-shadow: var(--shadow-sm);
    transform: scale(1.05);
}

.inputbar-send:active {
    background: var(--interactive-primary-active);
    transform: scale(0.95);
}

.inputbar-send:disabled {
    background: var(--panel-elevated);
    color: var(--text-disabled);
    cursor: not-allowed;
    transform: none;
}

.inputbar-attach {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.inputbar-attach:hover {
    background: var(--panel-elevated);
    color: var(--text-primary);
}

/* Toggle Components */
.toggles {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--panel-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--panel-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.toggle-switch:focus {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.toggle-switch.active {
    background: var(--interactive-primary);
    border-color: var(--interactive-primary);
}

.toggle-switch.active::before {
    left: 22px;
    background: var(--text-primary);
}

.toggle-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.toggle.active .toggle-label {
    color: var(--text-primary);
}

/* Chat Typing Indicator */
.chat-typing {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.chat-typing .bubble {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--panel-secondary);
    border: 1px solid var(--border-primary);
    min-width: 60px;
    max-width: 100px;
}

.typing-dots {
    display: flex;
    gap: var(--space-xs);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    animation: typing 1.5s infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Chat Responsive Design */
@media (max-width: 768px) {
    .bubble {
        max-width: 85%;
    }
    
    .msg-user .bubble,
    .msg-assistant .bubble {
        margin-left: var(--space-sm);
        margin-right: var(--space-sm);
    }
    
    .inputbar {
        padding: var(--space-sm);
    }
    
    .toggles {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
}

/* === SCROLLBAR STYLES === */
/* Custom scrollbars for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--panel-secondary);
    border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
    background: var(--interactive-primary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--interactive-primary-hover);
}

::-webkit-scrollbar-thumb:active {
    background: var(--interactive-primary-active);
}

::-webkit-scrollbar-corner {
    background: var(--panel-secondary);
}

/* Thin scrollbars for specific containers */
.chat-body::-webkit-scrollbar,
.diff-content::-webkit-scrollbar,
.column-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track,
.diff-content::-webkit-scrollbar-track,
.column-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-body::-webkit-scrollbar-thumb,
.diff-content::-webkit-scrollbar-thumb,
.column-body::-webkit-scrollbar-thumb {
    background: var(--border-muted);
    border-radius: var(--radius-full);
}

.chat-body::-webkit-scrollbar-thumb:hover,
.diff-content::-webkit-scrollbar-thumb:hover,
.column-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

/* Firefox scrollbar styling */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--interactive-primary) var(--panel-secondary);
}

.chat-body,
.diff-content,
.column-body {
    scrollbar-width: thin;
    scrollbar-color: var(--interactive-primary) transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

.chat-body,
.diff-content,
.column-body,
.content {
    scroll-behavior: smooth;
}
