/* NEURONEXCORP — Chat Page Styles */

.chat-page {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.chat-sidebar.collapsed {
  transform: translateX(-100%);
  position: absolute;
  z-index: 200;
  height: 100%;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}

.sidebar-brand .logo {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.btn-new-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-new-chat:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.session-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.session-item:hover {
  background: var(--bg-tertiary);
}

.session-item.active {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.session-title {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-time {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Main Chat */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-model {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.topbar-status {
  font-size: 12px;
  color: var(--success);
}

.topbar-actions {
  display: flex;
  gap: 6px;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.welcome-chat {
  text-align: center;
  padding: 60px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.welcome-chat-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.welcome-chat h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.welcome-chat p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.quick-prompt {
  padding: 8px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-prompt:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--text-primary);
}

/* Input Area */
.chat-input-area {
  padding: 12px 16px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.input-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.toolbar-btn.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
}

.input-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  position: relative;
}

.input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#chat-textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 20px;
  padding: 4px 0;
}

.voice-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  gap: 12px;
}

.voice-overlay-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
}

.voice-overlay-waves span {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: voiceWave 0.6s infinite ease-in-out alternate;
}

.voice-overlay-waves span:nth-child(1) { height: 10px; animation-delay: 0s; }
.voice-overlay-waves span:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.voice-overlay-waves span:nth-child(3) { height: 32px; animation-delay: 0.2s; }
.voice-overlay-waves span:nth-child(4) { height: 40px; animation-delay: 0.3s; }
.voice-overlay-waves span:nth-child(5) { height: 32px; animation-delay: 0.4s; }
.voice-overlay-waves span:nth-child(6) { height: 20px; animation-delay: 0.5s; }
.voice-overlay-waves span:nth-child(7) { height: 10px; animation-delay: 0.6s; }

@keyframes voiceWave {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1); }
}

.voice-overlay-text {
  font-size: 13px;
  color: var(--accent);
}

.send-btn-chat {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.send-btn-chat:hover:not(:disabled) {
  background: var(--accent-light);
}

.send-btn-chat:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.input-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 0 4px;
}

#chat-hint {
  font-size: 11px;
  color: var(--text-muted);
}

#chat-model-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Settings Modal Wide */
.modal-wide {
  max-width: 520px;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab-btn.active {
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.15);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.setting-row {
  margin-bottom: 16px;
}

.setting-row label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.setting-row input[type="text"],
.setting-row input[type="password"],
.setting-row input[type="number"],
.setting-row select,
.setting-row textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.setting-row input:focus,
.setting-row select:focus,
.setting-row textarea:focus {
  border-color: var(--accent);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Mobile */
@media (max-width: 768px) {
  .chat-sidebar {
    position: absolute;
    z-index: 200;
    transform: translateX(-100%);
  }
  .chat-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle { display: block; }
  .menu-toggle { display: block; }
  .chat-messages { padding: 12px; }
}
