:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --surface: #1a1a1a;
    --surface-hover: #222222;
    --border: #333333;
    --border-light: #404040;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #00ff88;
    --warning: #ffaa00;
    --error: #ff4444;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.6);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="red"] {
    --accent: #ef4444;
    --accent-hover: #dc2626;
}

[data-theme="orange"] {
    --accent: #f97316;
    --accent-hover: #ea580c;
}

[data-theme="yellow"] {
    --accent: #eab308;
    --accent-hover: #ca8a04;
}

[data-theme="green"] {
    --accent: #22c55e;
    --accent-hover: #16a34a;
}

[data-theme="blue"] {
    --accent: #3b82f6;
    --accent-hover: #2563eb;
}

[data-theme="purple"] {
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
}

[data-theme="pink"] {
    --accent: #ec4899;
    --accent-hover: #db2777;
}

[data-theme="light-red"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fef2f2;
    --bg-tertiary: #fecaca;
    --surface: #ffffff;
    --surface-hover: #fef2f2;
    --border: #fecaca;
    --border-light: #fca5a5;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --shadow: 0 8px 32px rgba(239, 68, 68, 0.1);
    --shadow-hover: 0 12px 48px rgba(239, 68, 68, 0.15);
}

[data-theme="light-orange"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fff7ed;
    --bg-tertiary: #fed7aa;
    --surface: #ffffff;
    --surface-hover: #fff7ed;
    --border: #fed7aa;
    --border-light: #fdba74;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --shadow: 0 8px 32px rgba(249, 115, 22, 0.1);
    --shadow-hover: 0 12px 48px rgba(249, 115, 22, 0.15);
}

[data-theme="light-yellow"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fefce8;
    --bg-tertiary: #fef08a;
    --surface: #ffffff;
    --surface-hover: #fefce8;
    --border: #fef08a;
    --border-light: #fde047;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #eab308;
    --accent-hover: #ca8a04;
    --shadow: 0 8px 32px rgba(234, 179, 8, 0.1);
    --shadow-hover: 0 12px 48px rgba(234, 179, 8, 0.15);
}

[data-theme="light-green"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f0fdf4;
    --bg-tertiary: #bbf7d0;
    --surface: #ffffff;
    --surface-hover: #f0fdf4;
    --border: #bbf7d0;
    --border-light: #86efac;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --shadow: 0 8px 32px rgba(34, 197, 94, 0.1);
    --shadow-hover: 0 12px 48px rgba(34, 197, 94, 0.15);
}

[data-theme="light-blue"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f9ff;
    --bg-tertiary: #bae6fd;
    --surface: #ffffff;
    --surface-hover: #f0f9ff;
    --border: #bae6fd;
    --border-light: #7dd3fc;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --shadow: 0 8px 32px rgba(59, 130, 246, 0.1);
    --shadow-hover: 0 12px 48px rgba(59, 130, 246, 0.15);
}

[data-theme="light-purple"] {
    --bg-primary: #ffffff;
    --bg-secondary: #faf5ff;
    --bg-tertiary: #e9d5ff;
    --surface: #ffffff;
    --surface-hover: #faf5ff;
    --border: #e9d5ff;
    --border-light: #d8b4fe;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
    --shadow-hover: 0 12px 48px rgba(139, 92, 246, 0.15);
}

[data-theme="light-pink"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fdf2f8;
    --bg-tertiary: #fbcfe8;
    --surface: #ffffff;
    --surface-hover: #fdf2f8;
    --border: #fbcfe8;
    --border-light: #f9a8d4;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-tertiary: #9ca3af;
    --accent: #ec4899;
    --accent-hover: #db2777;
    --shadow: 0 8px 32px rgba(236, 72, 153, 0.1);
    --shadow-hover: 0 12px 48px rgba(236, 72, 153, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    font-weight: 450;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: var(--transition);
}

.app-container {
    display: flex;
    height: 100vh;
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 40px 32px 32px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.app-logo {
    font-size: 2.4em;
    margin-bottom: 16px;
    color: var(--accent);
    opacity: 0.95;
    transition: var(--transition);
}

.app-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.sidebar-header h2 {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 0.85em;
    transition: var(--transition);
}

.sidebar-nav {
    flex: 1;
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    width: calc(100% - 16px);
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 16px 24px 16px 32px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95em;
    font-weight: 500;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    position: relative;
    margin-left: 8px;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item:hover::before {
    height: 20px;
}

.nav-item.active {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active::before {
    height: 32px;
    background: var(--accent);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
    transition: var(--transition);
}

.nav-item:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    background: var(--bg-secondary);
    transition: var(--transition);
}

#logout-btn {
    color: var(--error);
}

#logout-btn:hover {
    background: rgba(255, 68, 68, 0.1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.content-header {
    padding: 48px 48px 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: relative;
    transition: var(--transition);
}

.content-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 48px;
    right: 48px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.3;
}

.content-header h1 {
    font-size: 2.4em;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    transition: var(--transition);
}

.content-header p {
    color: var(--text-secondary);
    font-size: 1.1em;
    line-height: 1.6;
    max-width: 600px;
    transition: var(--transition);
}

.content-body {
    flex: 1;
    padding: 32px 48px;
    background: var(--bg-primary);
    overflow-y: auto;
    position: relative;
    transition: var(--transition);
}

/* Карточки */
.welcome-card {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.welcome-card i {
    font-size: 3em;
    color: var(--accent);
    margin-bottom: 24px;
    opacity: 0.9;
    transition: var(--transition);
}

.welcome-card h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.6em;
    font-weight: 700;
    transition: var(--transition);
}

.welcome-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
    font-size: 1.05em;
    transition: var(--transition);
}

/* Пустые вкладки */
.empty-tab {
    background: var(--surface);
    padding: 80px 48px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.empty-tab i {
    font-size: 4em;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    opacity: 0.5;
}

.empty-tab h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1.4em;
    font-weight: 600;
}

.empty-tab p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.05em;
}

.theme-container {
    max-width: 1000px;
    margin: 0 auto;
}

.current-theme-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 32px;
    transition: var(--transition);
}

.current-theme-card h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-theme-card h3 i {
    color: var(--accent);
}

.current-theme-preview {
    display: flex;
    gap: 24px;
    align-items: center;
}

.theme-preview-box {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    position: relative;
}

.preview-header {
    height: 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.preview-content {
    height: 60px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-accent {
    height: 20px;
    background: var(--accent);
}

.theme-info {
    flex: 1;
}

.theme-info h4 {
    color: var(--text-primary);
    font-size: 1.4em;
    margin-bottom: 8px;
    font-weight: 600;
}

.theme-info p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.theme-stats {
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.stat i {
    color: var(--accent);
}

.theme-palette-section {
    margin-bottom: 32px;
}

.theme-palette-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-palette-section h3 i {
    color: var(--accent);
}

.theme-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.theme-option {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-option:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.theme-option.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.theme-option.active::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8em;
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.theme-preview.light {
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

.theme-preview-header {
    height: 16px;
    background: var(--bg-secondary, #2d2d2d);
}

.theme-preview-content {
    height: 40px;
    background: var(--surface, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-preview-accent {
    height: 16px;
    background: var(--accent, #3b82f6);
}

.theme-option-info h4 {
    color: var(--text-primary);
    font-size: 1em;
    margin-bottom: 4px;
    font-weight: 600;
}

.theme-option-info p {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.theme-preview-section {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.theme-preview-section h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-preview-section h3 i {
    color: var(--accent);
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.preview-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.preview-header-preview {
    height: 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.preview-content-preview {
    padding: 16px;
}

.preview-text {
    height: 8px;
    background: var(--text-secondary);
    opacity: 0.6;
    border-radius: 4px;
    margin-bottom: 12px;
}

.preview-text:nth-child(2) {
    width: 80%;
}

.preview-button {
    height: 12px;
    background: var(--accent);
    border-radius: 6px;
    width: 60%;
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    background: var(--surface);
    padding: 8px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    border: none;
    padding: 20px 24px;
    font-size: 1.1em;
    border-radius: var(--radius-md);
    outline: none;
    color: var(--text-primary);
    background: transparent;
    font-weight: 450;
}

.search-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.search-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 20px 32px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.search-button:hover::before {
    left: 100%;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--accent) 40%, transparent);
}

.search-button:active {
    transform: translateY(0);
}

.search-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.search-button.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-group label {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

.param-select {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.95em;
    outline: none;
    transition: var(--transition);
    cursor: pointer;
}

.param-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.search-results {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow);
    min-height: 400px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.empty-state {
    text-align: center;
    color: var(--text-tertiary);
    padding: 80px 20px;
}

.empty-state i {
    font-size: 4em;
    margin-bottom: 24px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.1em;
}

.search-status {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: center;
    transition: var(--transition);
}

.search-status.success {
    background: color-mix(in srgb, var(--success) 10%, transparent);
    border-color: var(--success);
    color: var(--success);
}

.search-status.error {
    background: color-mix(in srgb, var(--error) 10%, transparent);
    border-color: var(--error);
    color: var(--error);
}

.search-status.loading {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: var(--accent);
    color: var(--accent);
}

.result-item {
    background: var(--bg-tertiary);
    padding: 20px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    transition: var(--transition);
}

.result-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.result-item h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: 600;
}

.result-item p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.result-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: var(--text-tertiary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active .content-body > * {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }
    
    .content-header {
        padding: 32px 24px 24px;
    }
    
    .content-body {
        padding: 24px;
    }
    
    .search-params {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-button {
        min-width: auto;
    }
    
    .current-theme-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .theme-stats {
        justify-content: center;
    }
    
    .theme-palette {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}