@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', monospace;
    background: #05070f;
    color: #e8edff;
    overflow-x: hidden;
}

/* ========== АНИМИРОВАННЫЙ ФОН ========== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse at 20% 30%, #0a0f2a 0%, #020408 100%);
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 40px); }
}

.noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-radial-gradient(circle at 20% 30%, rgba(0,255,255,0.02) 0px, transparent 2px);
    pointer-events: none;
}

/* ========== БОКОВОЕ МЕНЮ ========== */
.side-menu {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: rgba(5, 10, 22, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: all 0.3s ease;
}

.menu-header {
    padding: 30px 24px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
}

.logo-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #0ff, #b967ff);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.menu-header h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.menu-header h3 span {
    color: #0ff;
    font-weight: 800;
}

.status-led {
    display: inline-block;
    margin-top: 12px;
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 8px #0f0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.menu-nav {
    flex: 1;
    padding: 30px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #a0b3d9;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.nav-item i {
    width: 24px;
    font-size: 18px;
}

.nav-item:hover {
    background: rgba(0, 255, 255, 0.08);
    color: #0ff;
}

.nav-item.active {
    background: linear-gradient(95deg, rgba(0, 255, 255, 0.12), rgba(185, 103, 255, 0.08));
    color: #0ff;
    border-left: 2px solid #0ff;
}

.nav-indicator {
    position: absolute;
    right: 16px;
    width: 4px;
    height: 4px;
    background: #0ff;
    border-radius: 50%;
    opacity: 0;
}

.nav-item.active .nav-indicator {
    opacity: 1;
}

.menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 255, 255, 0.1);
}

.system-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    padding: 6px 0;
}

.info-row i {
    width: 20px;
    color: #0ff;
}

.theme-toggle {
    width: 100%;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    color: #0ff;
    cursor: pointer;
    transition: all 0.2s;
}

/* ========== ОСНОВНОЙ КОНТЕНТ ========== */
.main-content {
    margin-left: 280px;
    padding: 20px 32px;
    min-height: 100vh;
}

.glass-panel {
    background: rgba(8, 14, 26, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 20px;
    transition: all 0.2s;
}

.glass-panel:hover {
    border-color: rgba(0, 255, 255, 0.35);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
}

.top-bar {
    padding: 16px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.breadcrumb {
    font-size: 12px;
    color: #7a8aaa;
}

.breadcrumb i {
    margin: 0 6px;
    font-size: 10px;
}

.search-shortcut, .user-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== ПАНЕЛЬ ВВОДА ========== */
.input-panel {
    margin-bottom: 20px;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #0ff;
}

.input-wrapper {
    padding: 20px;
    position: relative;
}

#questionInput {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    color: #e8edff;
    font-family: 'Inter', monospace;
    font-size: 15px;
    resize: vertical;
}

#questionInput:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
}

.input-actions {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 8px;
}

.action-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    color: #0ff;
    cursor: pointer;
}

.control-bar {
    padding: 16px 20px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 255, 255, 0.08);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-size: 12px;
    color: #7a8aaa;
}

.tech-select {
    background: #0f1424;
    border: 1px solid #2a3a5a;
    padding: 6px 12px;
    border-radius: 8px;
    color: #0ff;
}

.threshold-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.threshold-wrapper input {
    width: 120px;
}

.tech-toggle {
    position: relative;
    width: 44px;
    height: 22px;
}

.tech-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a2340;
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: #0ff;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.submit-btn {
    background: linear-gradient(95deg, #0ff, #b967ff);
    border: none;
    padding: 8px 24px;
    border-radius: 40px;
    color: #05070f;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: btnShine 2s infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    20%, 100% { left: 100%; }
}

/* ========== ОТВЕТ ========== */
.response-panel {
    margin-bottom: 20px;
}

.response-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
}

.response-content {
    padding: 24px;
    line-height: 1.6;
}

.sources-section {
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0, 255, 255, 0.08);
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.source-badge-tech {
    background: rgba(0, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

/* ========== ДОКУМЕНТЫ ========== */
.docs-panel, .stats-panel {
    margin-bottom: 20px;
}

.docs-header, .stats-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-list {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.document-card-tech {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    border-left: 3px solid #0ff;
    cursor: pointer;
    transition: all 0.2s;
}

.document-card-tech:hover {
    transform: translateX(4px);
    background: rgba(0, 255, 255, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.stat-card {
    text-align: center;
    padding: 12px;
}

.stat-icon {
    font-size: 24px;
    color: #0ff;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ========== ЗАГРУЗКА ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.cyber-loader {
    width: 60px;
    height: 60px;
    border: 3px solid #0ff3;
    border-top: 3px solid #0ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== АДАПТИВ ========== */
@media (max-width: 992px) {
    .side-menu {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
    }
}