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

body {
    font-family: 'Consolas', 'Monaco', 'Liberation Mono', 'Lucida Console', monospace;
    background-color: #f5f5f5;
    color: #333;
}

.header {
    background: #2d2d2d;
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    z-index: 1001;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #dc3545;
}

.status-dot.online {
    background: #28a745;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: white;
    transition: 0.3s;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sidebar {
    position: fixed;
    top: 50px;
    right: 0;
    width: 250px;
    height: calc(100vh - 50px);
    background: #1a1a1a;
    color: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.visible {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    background: #252525;
}

.sidebar-header h3 {
    font-size: 16px;
    margin: 0;
    color: #ccc;
}

.sidebar-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-nav li {
    border-bottom: 1px solid #333;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: #ccc;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-nav a:hover {
    background: #333;
    color: white;
}

.sidebar-nav a.active {
    background: #af4444;
    color: white;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 1023px) {
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .menu-toggle {
        display: block !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}
    
@media (min-width: 1024px) {
    .menu-toggle {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-right: 250px !important;
        margin-left: 0 !important;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .header h1 a {
        font-size: 16px;
    }
}

.header h1 {
    display: flex;
}

.header h1 a {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #fd79a8);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 4s ease-in-out infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header a {
    color: #af4444;
    text-decoration: none;
    animation: rainbow 10s linear infinite;
}

@keyframes rainbow {
    0%{filter: hue-rotate(0deg);}
    100%{filter: hue-rotate(360deg);}
}

.section-selector {
    display: none;
}

.api-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.status-dot.checking {
    background-color: #ff9800;
    box-shadow: 0 0 6px rgba(255, 152, 0, 0.6);
    animation: pulse 1.5s infinite;
}

.main-content.with-sidebar-right {
    margin-right: 250px;
}

.main-content {
    margin-top: 50px;
    padding: 0;
    background: white;
    min-height: calc(100vh - 50px);
    transition: margin 0.3s ease;
}

.main-content.with-sidebar {
    margin-left: 250px;
}

.section {
    background: white;
    box-shadow: none;
    border-radius: 0;
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.loading {
    text-align: center;
    padding: 20px 12px;
    color: #666;
    font-size: 12px;
}

.error {
    text-align: center;
    padding: 20px 12px;
    color: #f44336;
    font-size: 12px;
}

.alert {
    margin: 20px;
    padding: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Дополнительные утилитарные классы */
.control-section {
    max-width: 600px;
    margin: 32px auto;
}

.hidden {
    display: none;
}

.pagination-info {
    display: none;
}

.pagination-container {
    display: none;
}

.form-group-inline {
    margin-bottom: 0;
}

.analysis-section {
    display: none;
}

.columns-editor {
    display: none;
}

.form-group-compact {
    margin: 12px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 3px;
}

.form-group-compact label {
    font-size: 12px;
    color: #666;
}

.form-group-compact input[type="number"] {
    width: 80px;
    margin-left: 8px;
}

.data-preview-section {
    display: none;
}

.file-navigation {
    display: none;
}

.file-nav-info {
    margin-left: 12px;
    font-size: 10px;
    color: #666;
    display: none;
}

.login-info {
    text-align: center;
    margin-bottom: 20px;
}

.logout-btn {
    background: #dc3545;
    margin-top: 10px;
}

.login-alert {
    margin-bottom: 20px;
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
}
