:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-sidebar: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-muted: #95a5a6;
    --border-color: #e1e5eb;
    --border-light: #eaeaea;
    --accent-primary: #3498db;
    --accent-success: #2ecc71;
    --accent-error: #e74c3c;
    --accent-warning: #f39c12;
    --accent-info: #3498db;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.08);
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
    --filter-bg: #f8f9fa;
    --filter-hover: #e9ecef;
    --chip-cpp: #e8f4fc;
    --chip-cpp-text: #2980b9;
    --chip-type: #f0f7f0;
    --chip-type-text: #27ae60;
    --chip-yes: #d4edda;
    --chip-yes-text: #155724;
    --chip-no: #f8d7da;
    --chip-no-text: #721c24;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-sidebar: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border-color: #404040;
    --border-light: #333333;
    --accent-primary: #5f5f5f;
    --accent-success: #81c784;
    --accent-error: #e57373;
    --accent-warning: #ffb74d;
    --accent-info: #64b5f6;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.4);
    --scrollbar-track: #2d2d2d;
    --scrollbar-thumb: #555555;
    --filter-bg: #3d3d3d;
    --filter-hover: #4d4d4d;
    --chip-cpp: #2d3b4d;
    --chip-cpp-text: #64b5f6;
    --chip-type: #2d4d3d;
    --chip-type-text: #81c784;
    --chip-yes: #2d4d3d;
    --chip-yes-text: #81c784;
    --chip-no: #4d2d3d;
    --chip-no-text: #e57373;
}

body {
    display: flex;
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    background-color: var(--bg-primary);
    height: 100vh;
    box-sizing: border-box;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-content {
    flex: 1;
    margin-right: 20px;
    overflow-y: auto;
    height: calc(100vh - 40px);
}

.filter-sidebar {
    width: 320px;
    min-width: 320px;
    background-color: var(--bg-sidebar);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
    height: 800px;
    max-height: 800px;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.theme-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}

.theme-toggle {
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--filter-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    text-align: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--filter-hover);
}

.theme-icon {
    font-size: 1.1em;
}

.theme-icon.sun {
    color: #f39c12;
}

.theme-icon.moon {
    color: #3498db;
}

.filter-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.filter-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.row {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
    position: relative;
}

.row:hover {
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-2px);
}

.name-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.row-number {
    background-color: var(--accent-primary);
    color: white;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.name {
    font-weight: bold;
    font-size: 1.3em;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.description {
    color: var(--text-secondary);
    margin: 8px 0 8px 40px;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.request, .response {
    background-color: var(--filter-bg);
    padding: 10px;
    border-radius: 4px;
    margin: 8px 0 8px 40px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    border-left: 3px solid var(--accent-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.response {
    border-left-color: var(--accent-success);
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 0 40px;
}

.writtenin, .type, .usage {
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.writtenin {
    background-color: var(--chip-cpp);
    color: var(--chip-cpp-text);
    border: 1px solid rgba(41, 128, 185, 0.3);
}

.type {
    background-color: var(--chip-type);
    color: var(--chip-type-text);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.usage-Yes {
    background-color: var(--chip-yes);
    color: var(--chip-yes-text);
    border: 1px solid rgba(21, 87, 36, 0.3);
}

.usage-No {
    background-color: var(--chip-no);
    color: var(--chip-no-text);
    border: 1px solid rgba(114, 28, 36, 0.3);
}

/* Стили для текстовых фильтров */
.text-filter {
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.text-filter-header {
    padding: 15px;
    background-color: var(--filter-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.text-filter-content {
    padding: 15px;
    background-color: var(--bg-sidebar);
}

.filter-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

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

.filter-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

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

.input-wrapper {
    position: relative;
}

.dropdown-section {
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dropdown-header {
    padding: 15px;
    background-color: var(--filter-bg);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.dropdown-header:hover {
    background-color: var(--filter-hover);
}

.dropdown-header.active {
    background-color: var(--accent-primary);
    color: white;
    border-bottom-color: var(--accent-primary);
}

.dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.dropdown-header.active {
    background-color: var(--accent-primary);
    color: white;
    border-bottom-color: var(--accent-primary);
}

.dropdown-icon {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.dropdown-header.active .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: var(--bg-sidebar);
}

.dropdown-content.expanded {
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-options {
    padding: 10px;
}

.filter-option {
    display: block;
    margin-bottom: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background-color: var(--filter-bg);
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95em;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.filter-option:hover {
    background-color: var(--filter-hover);
}

.filter-option.active {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.filter-reset {
    display: block;
    padding: 12px;
    margin-top: 10px;
    cursor: pointer;
    background-color: var(--filter-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.filter-reset:hover {
    background-color: var(--filter-hover);
    color: var(--text-primary);
}

.hidden {
    display: none;
}

.filter-count {
    display: block;
    padding: 12px;
    background-color: var(--filter-bg);
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.active-filters {
    font-size: 0.9em;
    color: var(--text-secondary);
    min-height: 20px;
    transition: color 0.3s ease;
}

/* Custom scrollbars */
.filter-content::-webkit-scrollbar,
.dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track,
.dropdown-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb,
.dropdown-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover,
.dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
        padding: 15px;
        height: auto;
    }
    
    .main-content {
        margin-right: 0;
        margin-bottom: 20px;
        height: auto;
        overflow-y: visible;
    }
    
    .filter-sidebar {
        width: 100%;
        position: static;
        height: auto;
        max-height: none;
    }
    
    .filter-content {
        overflow-y: visible;
    }
    
    .description,
    .request,
    .response,
    .meta-info {
        margin-left: 15px;
    }
}

@media (max-height: 900px) {
    .filter-sidebar {
        height: calc(100vh - 40px);
        max-height: calc(100vh - 40px);
    }
}