:root {
    /* Цветовая палитра для темной темы */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #21262d;
    --bg-hover: #30363d;
    --bg-overlay: rgba(13, 17, 23, 0.8);
    
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --accent: #238636;
    --accent-hover: #2ea043;
    
    --border: #30363d;
    --border-light: #3c444d;
    
    --success: #3fb950;
    --warning: #d29922;
    --error: #f85149;
    --info: #58a6ff;
    --purple: #a371f7;
    
    --shadow-sm: 0 1px 0 rgba(27, 31, 35, 0.04);
    --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    --transition-fast: 150ms;
    --transition-normal: 250ms;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;
    --bg-overlay: rgba(255, 255, 255, 0.9);
    
    --text-primary: #24292e;
    --text-secondary: #586069;
    --text-muted: #959da5;
    
    --accent: #2ea043;
    --accent-hover: #2c974b;
    
    --border: #e1e4e8;
    --border-light: #d1d5da;
    
    --success: #22863a;
    --warning: #b08800;
    --error: #cb2431;
    --info: #0366d6;
    --purple: #6f42c1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    overflow: hidden;
    position: relative;
}

@media (max-width: 1024px) {
    #main-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    #main-container {
        grid-template-rows: 400px 1fr;
    }
}

/* Типография */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p {
    margin-bottom: 1em;
}

a {
    color: var(--info);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

code {
    background: var(--bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow: auto;
    border: 1px solid var(--border);
}

/* Утилиты */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn var(--transition-normal) ease;
}

.slide-in {
    animation: slideIn var(--transition-normal) ease;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}