/* ==========================================================================
   Anton Web Panel — Dark Glass & Executive UI (Hermes Studio)
   ========================================================================== */

:root {
  --anton-glass-bg: rgba(22, 27, 34, 0.85);
  --anton-glass-border: rgba(255, 255, 255, 0.12);
  --anton-glass-glow: rgba(99, 102, 241, 0.2);
  --anton-accent: #6366f1;
  --anton-accent-hover: #4f46e5;
  --anton-text-primary: #f3f4f6;
  --anton-text-secondary: #9ca3af;
  --anton-radius: 12px;
}

/* --- 1. Стеклянный эффект боковой панели и шапки --- */
nav, aside, [role="region"] {
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

/* --- 2. Шапка навигации: кнопки быстрого доступа --- */
.hermes-nav-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--anton-glass-border);
}

.hermes-nav-buttons-row {
  display: flex;
  gap: 8px;
}

.hermes-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff !important;
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--anton-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hermes-btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

.hermes-btn-secondary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--anton-text-primary) !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--anton-radius);
  border: 1px solid var(--anton-glass-border);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hermes-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

/* --- 3. Бейджи статусов [Выполнено] / [В работе] --- */
.hermes-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin: 0 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  vertical-align: middle;
}

/* --- 4. Скрытие ненужных элементов и Торговой площадки (Point 4) --- */
[data-testid="nav-agents-marketplace-button"],
[aria-label="com_agents_marketplace"],
[aria-label*="marketplace" i],
[aria-label*="маркетплейс" i],
[aria-label*="торговая площадка" i],
a[href*="/marketplace"],
div[data-testid*="marketplace"],
button[data-testid*="speech"],
button[aria-label*="Прочитать" i],
button[aria-label*="Read" i],
button[data-testid*="fork"],
button[aria-label*="Fork" i],
button[aria-label*="Open Fork Menu" i],
nav[aria-label="Sibling message navigation"] {
  display: none !important;
}

/* Верхний нативный селектор модели остаётся как резервный (дубль внизу у микрофона) */

/* --- 5. Кнопка «Меню» рядом со скрепкой (Point 3) --- */
.hermes-input-menu-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  margin-right: 4px;
}

.hermes-input-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.hermes-input-menu-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
}

.hermes-commands-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: #181c24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.15);
  padding: 6px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: hermesFadeIn 0.15s ease-out;
}

.hermes-cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hermes-cmd-item:hover {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
}

.hermes-cmd-code {
  font-family: monospace;
  font-weight: 700;
  color: #818cf8;
}

.hermes-cmd-desc {
  font-size: 11px;
  color: #94a3b8;
}

/* --- 6. Выбор модели ИИ рядом с микрофоном (Point 2) --- */
.hermes-model-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.hermes-model-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.hermes-model-picker-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
}

.hermes-model-picker-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.hermes-model-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: #181c24;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.15);
  padding: 6px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: hermesFadeIn 0.15s ease-out;
}

.hermes-model-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hermes-model-item:hover {
  background: rgba(99, 102, 241, 0.25);
}

.hermes-model-item.active {
  background: rgba(99, 102, 241, 0.2);
  border-left: 3px solid #6366f1;
}

.hermes-model-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
}

.hermes-model-item-desc {
  font-size: 11px;
  color: #94a3b8;
}

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

/* --- 7. Мобильная адаптация --- */
@media (max-width: 768px) {
  textarea {
    font-size: 16px !important;
  }
  .hermes-nav-header {
    padding: 10px 12px;
  }
  .hermes-model-picker-btn span.label-text {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
