/* ========================================
   RESET & BASE STYLES - VS Code Dark Theme
   ======================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* VS Code Dark Theme Color Palette */
  --primary-color: #007ACC;
  --primary-hover: #0098FF;
  --primary-light: rgba(0, 122, 204, 0.2);
  --primary-dark: #005A9E;

  /* Accent Colors */
  --accent-blue: #569CD6;
  --accent-green: #4EC9B0;
  --accent-orange: #CE9178;
  --accent-yellow: #DCDCAA;
  --accent-purple: #C586C0;

  /* Backgrounds */
  --bg-primary: #1E1E1E;
  --bg-secondary: #252526;
  --bg-tertiary: #2D2D30;
  --bg-elevated: #333333;
  --bg-input: #3C3C3C;
  --bg-hover: #2A2D2E;
  --bg-active: #094771;

  /* Text Colors */
  --text-primary: #CCCCCC;
  --text-secondary: #9D9D9D;
  --text-light: #6A6A6A;
  --text-bright: #FFFFFF;
  --text-muted: #858585;

  /* Borders & Dividers */
  --border-color: #3E3E42;
  --border-light: #2B2B2B;
  --divider-color: #454545;

  /* Status Colors */
  --danger-color: #F48771;
  --success-color: #89D185;
  --warning-color: #E5C07B;
  --info-color: #61AFEF;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);

  /* Sizes */
  --topbar-height: 60px;
  --mobile-nav-height: 60px;
  --sidebar-width: 280px;
  --right-panel-width: 320px;

  /* Animations */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========================================
   APP LOADER - Fullscreen Initialization
   ======================================== */
.app-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease;
}

.app-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  animation: fadeInUp 0.5s ease;
}

.loader-logo {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 4px 16px rgba(0, 122, 204, 0.3);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

.loader-text {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   FIXED NAVIGATION (Новая навигация)
   ======================================== */
.fixed-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.nav-btn {
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--primary-color);
}

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary-color);
}

.nav-btn-center {
  width: 56px;
  height: 56px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  padding: 0;
}

.nav-btn-center:hover {
  border-color: var(--primary-color);
  background: var(--bg-elevated);
  transform: scale(1.05);
}

.nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* ========================================
   TOOLS PANEL (Левая панель инструментов)
   ======================================== */
.tools-panel {
  position: fixed;
  top: 0;
  bottom: 60px;
  left: 0;
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  z-index: 999;
  overflow-y: auto;
}

.tools-panel.active {
  transform: translateX(0);
}

.tools-panel::-webkit-scrollbar {
  width: 10px;
}

.tools-panel::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.tools-panel::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
}

.tools-panel::-webkit-scrollbar-thumb:hover {
  background: var(--divider-color);
}

.tools-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.tools-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.close-panel-btn {
  width: 32px;
  height: 32px;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.close-panel-btn:hover {
  background: var(--bg-hover);
  color: var(--danger-color);
}

/* Subscription Badge */
.subscription-badge {
  margin: 12px 16px;
  padding: 12px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(86, 156, 214, 0.1) 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.subscription-badge-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscription-badge-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-badge-plan {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
}

.subscription-badge-limit {
  font-size: 12px;
  color: var(--text-secondary);
}

.tools-menu {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tools-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.tools-menu-item:hover {
  background: var(--bg-hover);
  color: var(--primary-color);
}

.tools-menu-item.active {
  background: var(--bg-active);
  color: var(--primary-color);
}

.tools-menu-item.text-danger {
  color: var(--text-primary);
}

.tools-menu-item.text-danger:hover {
  background: rgba(244, 135, 113, 0.1);
  color: var(--danger-color);
}

.tools-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 8px;
}

/* ========================================
   HELP PANEL (Правая панель помощи)
   ======================================== */
.help-panel {
  position: fixed;
  top: 0;
  bottom: 60px;
  right: 0;
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: 999;
  overflow-y: auto;
}

.help-panel.active {
  transform: translateX(0);
}

.help-panel::-webkit-scrollbar {
  width: 10px;
}

.help-panel::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.help-panel::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
}

.help-panel::-webkit-scrollbar-thumb:hover {
  background: var(--divider-color);
}

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.help-panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
}

.help-menu {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.help-menu-item:hover {
  background: var(--bg-hover);
  color: var(--primary-color);
}

.help-menu-item.active {
  background: var(--bg-active);
  color: var(--primary-color);
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.main-container {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
  margin-bottom: 60px;
}

/* ========================================
   MAIN CONTENT (Чат + Визуализация)
   ======================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Chat Container - Центрированный */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px;
  padding-top: 40px;
  background: var(--bg-primary);
  gap: 16px;
  overflow-y: auto;
}

/* Chat Header with Bot Selector */
.chat-header {
  width: 100%;
  max-width: 700px;
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
  padding-top: 20px;
}

/* Bot Selector in Chat Header */
.bot-selector {
  position: relative;
  width: 45%;
}

.bot-selector-btn {
  width: 100%;
  min-height: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  transition: all var(--transition-fast);
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.bot-selector-btn:hover {
  border-color: var(--primary-color);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.15);
}

.bot-selector-btn #currentBotName {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Индикатор статуса в кнопке селектора */
.bot-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
  flex-shrink: 0;
  margin-right: 8px;
  animation: pulse-online 2s ease-in-out infinite;
}

.bot-status-indicator.offline {
  background: var(--text-light);
  animation: none;
}

/* Bot Selector Dropdown */
.bot-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  max-width: 90vw;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

.dropdown-header span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-close {
  width: 28px;
  height: 28px;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-close:hover {
  background: var(--bg-hover);
  color: var(--danger-color);
}

.dropdown-bots-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.dropdown-bots-list::-webkit-scrollbar {
  width: 6px;
}

.dropdown-bots-list::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-bots-list::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 3px;
}

.dropdown-bots-list::-webkit-scrollbar-thumb:hover {
  background: var(--divider-color);
}

.dropdown-bot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.dropdown-bot-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.dropdown-bot-item.active {
  background: var(--primary-light);
  border-color: var(--primary-color);
}

.dropdown-bot-item .bot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-bot-item .bot-avatar svg {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
}

.dropdown-bot-item .bot-info {
  flex: 1;
  min-width: 0;
}

.dropdown-bot-item .bot-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-bot-item .bot-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.dropdown-bot-item .bot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-color);
  flex-shrink: 0;
  position: relative;
  animation: pulse-online 2s ease-in-out infinite;
}

.dropdown-bot-item .bot-status.offline {
  background: var(--text-light);
  animation: none;
}

/* Анимация пульсации для онлайн статуса */
@keyframes pulse-online {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(137, 209, 133, 0.7);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(137, 209, 133, 0);
  }
}

.dropdown-footer {
  padding: 8px;
  border-top: 1px solid var(--border-color);
}

.dropdown-action-btn {
  width: 100%;
  height: 44px;
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.dropdown-action-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.dropdown-action-btn:active {
  transform: translateY(0);
}

.dropdown-empty-state {
  padding: 40px 20px;
  text-align: center;
}

.dropdown-empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.dropdown-empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.dropdown-empty-state p:first-of-type {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Chat Input - Центрированный */
.chat-input-container {
  width: 100%;
  max-width: 700px;
}

.chat-input-wrapper {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light), 0 8px 30px rgba(0, 122, 204, 0.2);
  transform: translateY(-2px);
}

#chatInput {
  flex: 1;
  min-height: 28px;
  max-height: 200px;
  padding: 4px 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-bright);
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
}

#chatInput::placeholder {
  color: var(--text-muted);
}

#chatInput::-webkit-scrollbar {
  width: 6px;
}

#chatInput::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 3px;
}

.send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  background: var(--bg-elevated);
  cursor: not-allowed;
  opacity: 0.4;
}

/* ========================================
   VISUALIZATION CONTAINER (Выдвижная панель снизу)
   ======================================== */
.visualization-container {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 70vh;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: translateY(calc(100% - 56px));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 900;
  overflow: hidden;
}

.visualization-container.expanded {
  transform: translateY(0);
}

.visualization-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  min-height: 56px;
  background: var(--bg-secondary);
  transition: background var(--transition-fast);
}

.visualization-header:hover {
  background: var(--bg-hover);
}

.visualization-header:active {
  background: var(--bg-tertiary);
}

.drag-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 5px;
  background: var(--divider-color);
  border-radius: 3px;
  transition: background var(--transition-fast);
}

.visualization-header:hover .drag-handle {
  background: var(--primary-color);
}

.visualization-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  margin-top: 8px;
}

.collapse-btn {
  position: absolute;
  right: 20px;
  width: 32px;
  height: 32px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.collapse-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.collapse-btn svg {
  transition: transform var(--transition-normal);
}

.visualization-container.expanded .collapse-btn svg {
  transform: rotate(180deg);
}

.visualization-content {
  flex: 1;
  padding: 20px;
  overflow: auto;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.visualization-content::-webkit-scrollbar {
  width: 10px;
}

.visualization-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.visualization-content::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 5px;
}

.visualization-content::-webkit-scrollbar-thumb:hover {
  background: var(--divider-color);
}

#botVisualization {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
}



/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
  .tools-panel,
  .help-panel {
    width: 320px;
  }

  .visualization-container {
    height: 65vh;
  }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
  .fixed-nav {
    padding: 0 12px;
  }

  .tools-panel,
  .help-panel {
    width: 100%;
    max-width: 320px;
  }

  .chat-container {
    padding: 16px;
  }

  .chat-input-wrapper {
    padding: 14px 16px;
  }

  #chatInput {
    font-size: 15px;
  }

  .send-btn {
    width: 40px;
    height: 40px;
  }

  .visualization-container {
    height: 65vh;
    transform: translateY(calc(100% - 52px));
  }
}

@media (max-width: 480px) {
  .chat-input-wrapper {
    padding: 12px 14px;
  }

  #chatInput {
    font-size: 14px;
  }

  .send-btn {
    width: 38px;
    height: 38px;
  }

  .chat-input-container {
    max-width: 100%;
  }
}


/* ========================================
   UTILITIES
   ======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 998;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1;
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 2;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-bright);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  gap: 12px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.step.active .step-number {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-bright);
}

.step.completed .step-number {
  background: var(--success-color);
  border-color: var(--success-color);
  color: var(--bg-primary);
}

.step-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--primary-color);
}

.step-divider {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  margin-bottom: 28px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-bright);
  font-size: 14px;
  font-family: 'Inter', monospace;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-tertiary);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-input::placeholder {
  color: var(--text-light);
}

.input-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.input-hint.error {
  color: var(--danger-color);
}

.input-hint.success {
  color: var(--success-color);
}

/* Info Box */
.info-box {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(97, 175, 239, 0.1);
  border: 1px solid rgba(97, 175, 239, 0.3);
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-primary);
}

.info-box svg {
  flex-shrink: 0;
  color: var(--info-color);
  margin-top: 2px;
}

.info-box p {
  margin: 0 0 8px 0;
}

.info-box ol {
  margin: 0;
  padding-left: 20px;
}

.info-box li {
  margin: 4px 0;
}

.info-box code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  color: var(--accent-yellow);
}

.info-box a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.info-box a:hover {
  text-decoration: underline;
}

.info-box-success {
  background: rgba(137, 209, 133, 0.1);
  border-color: rgba(137, 209, 133, 0.3);
}

.info-box-success svg {
  color: var(--success-color);
}

/* Validation Status */
.validation-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-primary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bot Info Display */
.bot-info {
  margin-top: 16px;
  padding: 16px;
  background: rgba(137, 209, 133, 0.1);
  border: 1px solid rgba(137, 209, 133, 0.3);
  border-radius: 6px;
}

.bot-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--success-color);
  font-weight: 600;
  font-size: 14px;
}

.bot-info-header svg {
  flex-shrink: 0;
}

.bot-info-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bot-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.bot-info-row .label {
  color: var(--text-secondary);
}

.bot-info-row .value {
  color: var(--text-bright);
  font-weight: 500;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-bright);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

/* Modal Step Visibility */
.modal-step {
  animation: fadeInStep 0.3s ease;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  .modal {
    padding: 0;
  }

  .step-indicator {
    margin-bottom: 24px;
  }

  .step-divider {
    width: 40px;
  }
}

/* ==========================================
   CLAUDE SESSION STATUS INDICATOR
   ========================================== */

.claude-session-indicator {
  margin: 12px 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.session-indicator-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-indicator-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.session-indicator-icon {
  font-size: 20px;
  animation: pulse 2s ease-in-out infinite;
}

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

.session-indicator-title {
  flex: 1;
  font-size: 14px;
}

.session-indicator-duration {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.session-indicator-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #00b4d8);
  border-radius: 3px;
  transition: width 0.3s ease;
  animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: 200px 0;
  }
}

.progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
  font-family: 'Courier New', monospace;
}

.session-indicator-action {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 28px;
  position: relative;
}

.session-indicator-action::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.session-indicator-stats {
  display: flex;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.session-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.session-stat svg {
  opacity: 0.6;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .claude-session-indicator {
    margin: 8px 12px;
    padding: 12px;
  }

  .session-indicator-header {
    font-size: 13px;
  }

  .session-indicator-action {
    font-size: 12px;
  }
}

/* ========================================
   VERSION CARDS - Git version management UI
   ======================================== */

.version-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.version-card:hover {
  background: var(--bg-elevated);
  border-color: var(--primary-color);
}

.version-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.version-card-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.version-id {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
}

.version-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.version-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.version-badge.current {
  background: var(--accent-green);
  color: var(--bg-primary);
}

.version-badge.auto {
  background: rgba(86, 156, 214, 0.2);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

.version-card-body {
  margin-bottom: 12px;
}

.version-commit {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  margin-bottom: 8px;
}

.version-message {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 500;
}

.version-prompt {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-yellow);
  border-radius: 4px;
  line-height: 1.5;
  margin-top: 8px;
}

.version-card-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.version-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

.version-btn.primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-bright);
}

.version-btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.version-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.version-btn svg {
  width: 14px;
  height: 14px;
}

/* Mobile adjustments for version cards */
@media (max-width: 768px) {
  .version-card {
    padding: 12px;
  }

  .version-card-footer {
    flex-direction: column;
  }

  .version-btn {
    width: 100%;
    justify-content: center;
  }
}
