@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* =========================================
   ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ (ILUHIN TOOLS)
   ========================================= */
:root {
    --bg: #0d0d12;
    --card: #16161f;
    --panel: #1e1e2a;
    --border: #2a2a38;
    --text: #f0f0f5;
    --muted: #8888a0;
    --accent: linear-gradient(135deg, #a855f7, #ec4899);
    --input: rgba(0, 0, 0, 0.25);
    --radius: 12px;
}

/* =========================================
   БАЗА И СКРОЛЛБАР
   ========================================= */
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

* {
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* =========================================
   ОБЩАЯ ОБЕРТКА ДЛЯ ВСЕХ МОДУЛЕЙ
   ========================================= */
.vc-wrap, 
.aiimg-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    max-width: 800px;
    margin: 40px auto;
}

.vc-header, 
.aiimg-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.02);
}

.vc-icon, 
.aiimg-icon {
    width: 48px; 
    height: 48px;
    border-radius: 14px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 20px; 
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.vc-header-text, 
.aiimg-header-text {
    flex: 1;
}

.vc-title, 
.aiimg-title { 
    font-size: 18px; 
    font-weight: 700; 
    margin-bottom: 4px; 
}

.vc-subtitle, 
.aiimg-subtitle { 
    font-size: 13px; 
    color: var(--muted); 
}

.vc-body, 
.aiimg-body { 
    padding: 25px; 
}

/* =========================================
   МОДУЛЬ: ВИДЕОЗВОНКИ (VIDEO CALL)
   ========================================= */
.vc-room-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
}

#vc-room-id {
    flex: 1; 
    background: var(--input); 
    border: 1px solid var(--border);
    color: #fff; 
    padding: 15px; 
    border-radius: 14px; 
    font-size: 20px;
    text-align: center; 
    letter-spacing: 6px; 
    font-family: monospace; 
    outline: none;
    transition: 0.3s;
}

#vc-room-id:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168,85,247,0.2);
}

.vc-btn-icon {
    width: 56px; 
    border: none; 
    border-radius: 14px; 
    background: var(--panel);
    color: var(--muted); 
    font-size: 20px; 
    cursor: pointer; 
    transition: 0.2s;
}

.vc-btn-icon:hover { 
    background: var(--border); 
    color: #fff; 
}

.vc-room-status {
    text-align: center; 
    font-size: 13px; 
    color: var(--muted);
    margin-bottom: 25px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
}

.vc-status-dot { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    background: #9f1239; 
    transition: 0.3s;
}
.vc-status-dot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.vc-status-dot.yellow { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.vc-status-dot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.vc-controls { 
    display: flex; 
    gap: 12px; 
}

.vc-btn {
    flex: 1; 
    padding: 16px; 
    border: none; 
    border-radius: 14px;
    color: #fff; 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s;
}

.vc-btn:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
}

.vc-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.vc-btn-alt { 
    background: var(--panel); 
}

.vc-btn-alt:not(:disabled):hover { 
    background: var(--border); 
}

.vc-btn-danger { 
    background: #ef4444; 
    width: 100%; 
}

.vc-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239,68,68,0.3);
}

.vc-message {
    text-align: center; 
    font-size: 14px; 
    font-weight: 600;
    padding: 15px; 
    margin-bottom: 15px; 
    border-radius: 12px;
}

.vc-video-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

@media (max-width: 650px) { 
    .vc-video-grid { grid-template-columns: 1fr; } 
}

.vc-video-box {
    background: #000; 
    border-radius: 16px; 
    overflow: hidden;
    aspect-ratio: 4/3; 
    position: relative; 
    border: 1px solid var(--border);
}

.vc-video-box video { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.vc-label {
    position: absolute; 
    top: 12px; 
    left: 12px; 
    background: rgba(0,0,0,0.6);
    padding: 5px 12px; 
    border-radius: 8px; 
    font-size: 12px; 
    color: #fff; 
    backdrop-filter: blur(4px);
    font-weight: 600;
}

/* =========================================
   МОДУЛЬ: НЕЙРОСЕТИ (AI MULTI-CHAT)
   ========================================= */
.ai-chat-header-actions { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 15px; 
}

.ai-models-tabs {
    display: flex; 
    background: var(--input); 
    padding: 5px;
    border-radius: 14px; 
    position: relative; 
    flex: 1; 
    overflow-x: auto;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.ai-models-slider {
    position: absolute; 
    top: 5px; 
    bottom: 5px; 
    background: var(--accent);
    border-radius: 10px; 
    transition: 0.4s cubic-bezier(0.34, 1.15, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.ai-model-tab {
    flex: 1; 
    padding: 12px 10px; 
    border: none; 
    background: transparent;
    color: var(--muted); 
    font-weight: 600; 
    cursor: pointer; 
    position: relative; 
    z-index: 2;
    font-size: 13px; 
    transition: color 0.3s ease; 
    white-space: nowrap;
}

.ai-model-tab.active { 
    color: #fff; 
}

.ai-model-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-clear-btn {
    background: var(--input); 
    border: none; 
    border-radius: 14px;
    width: 46px; 
    color: var(--muted); 
    cursor: pointer; 
    transition: 0.2s;
}

.chat-clear-btn:hover { 
    background: #ef4444; 
    color: #fff; 
}

.ai-chat-messages {
    height: 450px; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 15px;
    padding-right: 10px; 
    margin-bottom: 15px;
}

.ai-msg { 
    max-width: 85%; 
    padding: 14px 18px; 
    border-radius: 18px; 
    font-size: 14px; 
    line-height: 1.6; 
}

.ai-msg.bot { 
    background: var(--panel); 
    border-bottom-left-radius: 4px; 
    align-self: flex-start;
    border: 1px solid var(--border);
}

.ai-msg.user { 
    background: var(--accent); 
    color: #fff; 
    border-bottom-right-radius: 4px; 
    align-self: flex-end; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.ai-chat-input-row { 
    display: flex; 
    gap: 10px; 
    background: var(--input); 
    padding: 6px; 
    border-radius: 18px;
    border: 1px solid var(--border);
}

#chat-input {
    flex: 1; 
    background: transparent; 
    border: none; 
    color: #fff;
    padding: 12px 15px; 
    font-size: 14px; 
    resize: none; 
    outline: none; 
    font-family: 'Inter', sans-serif;
}

#chat-input::placeholder {
    color: var(--muted);
}

#chat-send {
    background: var(--accent); 
    border: none; 
    width: 46px; 
    height: 46px;
    border-radius: 14px; 
    color: #fff; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: 0.2s;
}

#chat-send:hover {
    transform: scale(1.05);
}