/* DevopsYatra AI Agent Styles */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.markdown-body {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #e2e8f0;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}
.markdown-body p,
.markdown-body li {
  margin-bottom: 0.75rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.markdown-body p:last-child {
  margin-bottom: 0;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-weight: 600;
  color: #f8fafc;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  word-break: break-word;
}
.markdown-body h1 { font-size: 1.25rem; }
.markdown-body h2 { font-size: 1.1rem; }
.markdown-body h3 { font-size: 1.0rem; }

.markdown-body ul, .markdown-body ol {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}
.markdown-body ul { list-style-type: disc; }
.markdown-body ol { list-style-type: decimal; }

.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82em;
  padding: 0.15em 0.35em;
  background-color: #1e293b;
  border-radius: 0.25rem;
  color: #38bdf8;
  word-break: break-word;
}

.markdown-body pre {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  background-color: #0f172a;
  border: 1px solid #1e293b;
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

.markdown-body pre code {
  padding: 2.2rem 0.85rem 0.85rem 0.85rem;
  display: block;
  background: transparent;
  color: #f1f5f9;
  font-size: 0.82rem;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  word-break: normal;
}

.markdown-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
}
.markdown-body th, .markdown-body td {
  border: 1px solid #334155;
  padding: 0.4rem 0.6rem;
  text-align: left;
}
.markdown-body th {
  background-color: #1e293b;
  font-weight: 600;
}

.typing-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background-color: #6366f1;
  margin-left: 3px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

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

@media (max-width: 640px) {
  #chat-messages {
    overflow-x: hidden !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .markdown-body {
    font-size: 0.82rem;
  }
  .markdown-body pre code {
    font-size: 0.76rem;
    padding-top: 2.1rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }
  .markdown-body table {
    font-size: 0.75rem;
  }
}

/* Antigravity Replica Styles */
.mic-recording {
  color: #f43f5e !important;
  background-color: rgba(244, 63, 94, 0.2) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
  border-radius: 0.75rem;
  animation: mic-pulse 1.2s infinite ease-in-out;
}

.mic-recording svg {
  stroke: #f43f5e !important;
}

#voice-lang-btn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#voice-lang-btn:active {
  transform: scale(0.93);
}

@keyframes mic-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(244, 63, 94, 0);
  }
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 3px 8px;
  font-size: 11px;
  color: #e2e8f0;
  transition: all 0.15s ease;
}

.attachment-chip:hover {
  border-color: #64748b;
  background-color: #243047;
}

.folder-header-btn {
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.folder-header:hover .folder-header-btn {
  opacity: 1;
}

.folder-chevron {
  transition: transform 0.2s ease-in-out;
}

.folder-chevron.collapsed {
  transform: rotate(-90deg);
}

/* Antigravity Agent Activity Stream */
.activity-stream {
  margin-bottom: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  user-select: none;
}

.thought-accordion {
  border-radius: 0.5rem;
  transition: all 0.15s ease;
  margin: 0.15rem 0;
}

.thought-accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.15rem 0;
  transition: color 0.15s ease;
}

.thought-accordion summary::-webkit-details-marker {
  display: none;
}

.thought-accordion summary:hover {
  color: #cbd5e1;
}

.thought-content {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #94a3b8;
  border-left: 2px solid #334155;
  padding-left: 0.75rem;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  user-select: text;
  white-space: pre-wrap;
}

.activity-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #94a3b8;
  padding: 0.15rem 0;
  word-break: break-word;
}

.activity-status-line {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  padding: 0.2rem 0;
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: anywhere;
}

.activity-path-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.08rem 0.35rem;
  border-radius: 0.35rem;
  word-break: break-all;
  display: inline;
}

/* --- Antigravity-Style Action Feed Accordion & Command Drawers --- */
.action-feed-accordion {
  margin: 0.3rem 0 0.55rem 0;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(51, 65, 85, 0.45);
  transition: all 0.2s ease;
  overflow: hidden;
}

.action-feed-accordion[open] {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(15, 23, 42, 0.7);
}

.action-feed-header {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.action-feed-header::-webkit-details-marker {
  display: none;
}

.action-feed-header:hover {
  color: #f1f5f9;
  background: rgba(30, 41, 59, 0.4);
}

.action-feed-summary-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.action-feed-chevron {
  transition: transform 0.2s ease;
}

.action-feed-accordion[open] .action-feed-chevron {
  transform: rotate(180deg);
}

.action-feed-items {
  padding: 0.25rem 0.7rem 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid rgba(51, 65, 85, 0.25);
}

/* Individual Collapsible Command Pill (Ran python / Ran command) */
.action-feed-command-item {
  border-radius: 0.45rem;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(30, 41, 59, 0.7);
  overflow: hidden;
  margin: 0.1rem 0;
  transition: border-color 0.15s ease;
}

.action-feed-command-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.action-cmd-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.75rem;
  transition: background 0.15s ease;
}

.action-cmd-summary::-webkit-details-marker {
  display: none;
}

.action-cmd-summary:hover {
  background: rgba(30, 41, 59, 0.5);
}

.action-cmd-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.action-cmd-prefix {
  color: #64748b;
  font-weight: 500;
  font-size: 0.73rem;
  flex-shrink: 0;
}

.action-cmd-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #cbd5e1;
  font-size: 0.73rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-cmd-arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.action-feed-command-item[open] .action-cmd-arrow {
  transform: rotate(90deg);
}

.action-cmd-drawer {
  padding: 0.5rem 0.65rem;
  background: #060913;
  border-top: 1px solid rgba(30, 41, 59, 0.75);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  overflow-x: auto;
}

.action-cmd-prompt {
  color: #818cf8;
  margin-bottom: 0.35rem;
  white-space: pre-wrap;
  word-break: break-all;
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}

.action-cmd-output {
  color: #94a3b8;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 0.35rem 0.45rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 0.3rem;
  border: 1px solid rgba(30, 41, 59, 0.5);
}

.activity-file-badge {
  font-weight: 500;
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.activity-file-badge.interactive-file-badge {
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.activity-file-badge.interactive-file-badge:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.activity-lines-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  color: #64748b;
}

.diff-add {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #34d399;
}

.diff-del {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f87171;
}

.working-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #94a3b8;
  padding: 0.2rem 0;
}

.working-indicator.modern-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #c7d2fe;
  padding: 0.35rem 0.75rem;
  margin: 0.3rem 0;
  border-radius: 0.75rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.working-indicator .working-timer-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(49, 46, 129, 0.7);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.working-indicator .working-dots {
  display: inline-flex;
  gap: 2.5px;
  align-items: center;
}

.working-indicator .working-dot {
  width: 3.5px;
  height: 3.5px;
  border-radius: 9999px;
  background-color: #818cf8;
  animation: pulse-dot 1.4s infinite ease-in-out both;
}

.working-indicator .working-dot:nth-child(1) { animation-delay: -0.32s; }
.working-indicator .working-dot:nth-child(2) { animation-delay: -0.16s; }
.working-indicator .working-dot:nth-child(3) { animation-delay: 0s; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(0.7); opacity: 0.35; }
  50% { transform: scale(1.3); opacity: 1; }
}

.tasks-running-card {
  position: absolute;
  bottom: 80px;
  right: 16px;
  background-color: rgba(15, 23, 42, 0.95);
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 0.6rem 0.85rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  z-index: 40;
  max-width: 380px;
  font-size: 0.75rem;
}

/* --- Web SSH Terminal & MobaXterm Tabs Styles --- */
.ssh-tab-item {
  border-top: 2px solid transparent;
  color: #94a3b8;
  background-color: transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.ssh-tab-item:hover {
  color: #f1f5f9;
  background-color: #1e293b;
}
.ssh-tab-item.active {
  border-top-color: #10b981;
  color: #ffffff;
  background-color: #0b0f19;
}

.ssh-server-card {
  transition: all 0.15s ease-in-out;
  border: 1px solid #1e293b;
}
.ssh-server-card:hover {
  border-color: #334155;
  background-color: #1e293b;
}

#terminal-viewport .xterm {
  height: 100%;
  width: 100%;
  padding: 4px 6px;
}
#terminal-viewport .xterm-viewport {
  overflow-y: auto !important;
}
#terminal-viewport .xterm-screen {
  width: 100% !important;
}

/* Enable free text selection and copy across chat messages and code blocks */
#chat-messages,
.chat-message,
.markdown-body,
.markdown-body pre,
.markdown-body code,
.plan-card,
.plan-body {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* AI Flag / Model Badge Visibility Controller (Default: OFF / Hidden) */
body.hide-model-flag .model-badge-slot,
.hide-model-flag .model-badge-slot {
  display: none !important;
}

/* Antigravity Artifact Drawer & File Links Enhancement */
#artifact-drawer {
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-text a[href*=".md"],
.message-text a[href^="file:"],
.message-text a[href*="implementation_plan"],
.message-text a[href*="walkthrough"] {
  cursor: pointer !important;
  color: #818cf8 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  transition: color 0.15s ease-in-out;
}

.message-text a[href*=".md"]:hover,
.message-text a[href^="file:"]:hover,
.message-text a[href*="implementation_plan"]:hover,
.message-text a[href*="walkthrough"]:hover {
  color: #c7d2fe !important;
  background-color: rgba(99, 102, 241, 0.12);
  border-radius: 4px;
  padding: 0 2px;
}

.clickable-file-badge,
.interactive-plan-file-badge,
.activity-file-badge,
.interactive-file-badge {
  cursor: pointer !important;
  color: #38bdf8 !important;
  background: rgba(14, 165, 233, 0.16) !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  border-radius: 6px !important;
  padding: 1.5px 7px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease-in-out !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.clickable-file-badge:hover,
.interactive-plan-file-badge:hover,
.activity-file-badge:hover,
.interactive-file-badge:hover {
  background: rgba(14, 165, 233, 0.32) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important;
  transform: translateY(-1px);
}

.message-text blockquote code,
.message-text code[title*="Artifact"],
.message-text code[title*="Drawer"],
.message-text code.clickable-file-badge,
.message-text code:hover {
  cursor: pointer !important;
}

/* Antigravity Implementation Plan Callout Banner & Proceed Button */
.plan-callout-banner {
  margin: 0.85rem 0;
  padding: 0.85rem 1.1rem;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 0.85rem;
  box-shadow: 0 6px 20px -3px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .plan-callout-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.plan-callout-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.plan-callout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.05rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 0.55rem;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer !important;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  user-select: none;
}

.plan-callout-btn:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.plan-callout-btn:active {
  transform: translateY(0);
}

.plan-callout-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.plan-reject-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 0.55rem;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer !important;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
  user-select: none;
}

.plan-reject-btn:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}

.plan-reject-btn:active {
  transform: translateY(0);
}

/* Service Notice Interactive Retry Card */
.service-notice-retry-card {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(69, 26, 3, 0.45);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  user-select: none;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.3);
}

.service-notice-retry-card .retry-hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: #fde68a;
}

.service-retry-action-btn {
  padding: 0.45rem 1rem;
  background: #d97706;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 0.55rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.service-retry-action-btn:hover {
  background: #f59e0b;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.service-retry-action-btn:active {
  transform: scale(0.96);
}





