/**
 * LLM Manager - Styles with Harmoniq Branding
 */


/* General app styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

/* Loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
}

/* Theme toggle styles */
.theme-toggle-icon {
    transition: transform 0.3s ease;
}

.theme-toggle-icon--dark {
    transform: rotate(180deg);
}

/* Header and navigation styles */
.v-app-bar-title {
    font-weight: 500 !important;
}

/* Tables and cards */
.v-data-table td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Schema and code editors */
.font-monospace {
    font-family: 'Roboto Mono', monospace !important;
}

pre.font-monospace {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Forms */
.prompt-textarea textarea,
.font-monospace textarea {
    font-family: 'Roboto Mono', monospace !important;
    font-size: 14px;
    line-height: 1.5;
}

/* Mobile-specific styles */
@media (max-width: 960px) {
    .v-data-table td {
        max-width: 150px;
    }
}

/* App History Dialog styles */
.request-prompt {
    white-space: pre-wrap;
    word-break: break-word;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: 4px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
}

.v-theme--dark .request-prompt {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Custom scrollbar for prompt */
.request-prompt::-webkit-scrollbar {
    width: 8px;
}

.request-prompt::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.request-prompt::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.request-prompt::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.v-theme--dark .request-prompt::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.v-theme--dark .request-prompt::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

.v-theme--dark .request-prompt::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Agent Builder Styles */
.agent-builder-canvas {
    position: relative;
    min-height: 100vh;
}

.agent-card {
    position: relative;
}

.connection-points {
    position: relative;
}

.connection-point {
    position: absolute;
    z-index: 20;
}

.connection-point .v-btn {
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 48px;
    height: 48px;
}

.connection-point .v-btn.connected {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
}

.connection-label {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 21;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.connection-point:hover .connection-label {
    opacity: 1;
    visibility: visible;
}

.v-theme--dark .connection-label {
    background: #2d2d2d;
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.connection-card {
    position: relative;
}

.connection-card .v-card-text {
    max-height: 150px;
    overflow-y: auto;
}

/* Connection line animations */
.agent-builder-canvas svg line {
    animation: connection-pulse 2s infinite;
}

@keyframes connection-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Responsive adjustments for agent builder */
@media (max-width: 768px) {
    .agent-card {
        width: 240px !important;
    }
    
    .connection-card {
        width: 160px !important;
    }
    
    .connection-label {
        font-size: 10px;
    }
}

/* CRON schedule preview styles */
.cron-preview {
    background-color: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding: 12px;
    margin: 8px 0;
}

.v-theme--dark .cron-preview {
    background-color: rgba(102, 126, 234, 0.2);
}

/* Tool Selection Dialog Styles */
.tool-selection-card {
    transition: all 0.2s ease;
}

.tool-selection-card:hover {
    background-color: rgba(255, 152, 0, 0.05);
    border-color: #FF9800 !important;
}

.tool-selection-card.selected {
    background-color: rgba(255, 152, 0, 0.1);
    border-color: #FF9800 !important;
    border-width: 2px !important;
}

.v-theme--dark .tool-selection-card:hover {
    background-color: rgba(255, 152, 0, 0.1);
}

.v-theme--dark .tool-selection-card.selected {
    background-color: rgba(255, 152, 0, 0.15);
}

.tools-selection-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 152, 0, 0.3) transparent;
}

.tools-selection-list::-webkit-scrollbar {
    width: 8px;
}

.tools-selection-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.tools-selection-list::-webkit-scrollbar-thumb {
    background: rgba(255, 152, 0, 0.3);
    border-radius: 4px;
}

.tools-selection-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 152, 0, 0.5);
}

/* Resource selection styles */
.resource-selection-card {
    transition: all 0.2s ease;
}

.resource-selection-card:hover {
    background-color: rgba(76, 175, 80, 0.05);
    border-color: #4CAF50 !important;
}

.resource-selection-card.selected {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50 !important;
    border-width: 2px !important;
}

.v-theme--dark .resource-selection-card:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.v-theme--dark .resource-selection-card.selected {
    background-color: rgba(76, 175, 80, 0.15);
}

/* Model selection styles */
.model-selection-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-selection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #2196F3 !important;
}

.model-selection-card.selected {
    border-color: #2196F3 !important;
    background-color: rgba(33, 150, 243, 0.05);
}

.models-selection-list {
    max-height: 400px;
    overflow-y: auto;
}

.models-selection-list::-webkit-scrollbar {
    width: 6px;
}

.models-selection-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.models-selection-list::-webkit-scrollbar-thumb {
    background: rgba(25, 118, 210, 0.3);
    border-radius: 3px;
}

.models-selection-list::-webkit-scrollbar-thumb:hover {
    background: rgba(25, 118, 210, 0.5);
}

/* Chat Dialog Styles */
.chat-messages {
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 150, 136, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 150, 136, 0.5);
}

.message-bubble {
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.conversation-item:hover {
    background-color: rgba(0, 150, 136, 0.04) !important;
}

/* Visual Agent Builder Styles */
.visual-agent-builder {
  width: 100%;
  height: 600px;
  position: relative;
  overflow: hidden;
}

.visual-builder-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
              linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
              linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
              linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.visual-builder-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.visual-builder-nodes {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.visual-node {
  position: absolute;
  width: 180px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid #e0e0e0;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: translate(-50%, -50%);
}

.visual-node:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-color: #667eea;
}

.visual-node.connected {
  border-color: #4CAF50;
  background: linear-gradient(135deg, #ffffff 0%, #f8fff8 100%);
}

.visual-node.active {
  border-color: #2196F3;
  background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.agent-node {
  width: 220px;
  background: white;
  color: black;
  border-color: #5a67d8;
}

.agent-node:hover {
  border-color: #4c51bf;
}

.agent-node .node-content h4,
.agent-node .node-content h5,
.agent-node .node-content p {
  color: #333 !important;
  text-shadow: none !important;
  font-weight: 600;
}

.roles-node {
  width: 220px;
  border-color: #E91E63;
}

.roles-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #fce4ec 100%);
  border-color: #C2185B;
}

.model-node {
  border-color: #2196F3;
}

.model-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
  border-color: #1976D2;
}

.schedule-node {
  border-color: #9C27B0;
}

.schedule-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #f3e5f5 100%);
  border-color: #7B1FA2;
}

.prompt-node {
  border-color: #00BCD4;
}

.prompt-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #e0f7fa 100%);
  border-color: #0097A7;
}

.tools-node {
  border-color: #FF9800;
}

.tools-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #fff3e0 100%);
  border-color: #F57C00;
}

.resources-node {
  border-color: #4CAF50;
}

.resources-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #e8f5e8 100%);
  border-color: #388E3C;
}

.conversations-node {
  border-color: #009688;
}

.conversations-node.connected {
  background: linear-gradient(135deg, #ffffff 0%, #e0f2f1 100%);
  border-color: #00695C;
}

.node-icon {
  text-align: center;
  margin-bottom: 8px;
}

.node-content h4, .node-content h5 {
  margin: 0 0 4px 0;
  font-weight: 600;
  color: #333;
}

.node-content p {
  margin: 0;
  font-size: 12px;
  color: #555;
  font-weight: 500;
}

.agent-node .node-content h4,
.agent-node .node-content h5,
.agent-node .node-content p {
  color: #F5F5F5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  font-weight: 600;
}

.connection-line {
  stroke-linecap: round;
  transition: all 0.3s ease;
}

.connection-line:hover {
  stroke-width: 4 !important;
  opacity: 1 !important;
}

/* Dark theme support */
.v-theme--dark .visual-builder-container {
  background: linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
              linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
              linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
              linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
}

.v-theme--dark .visual-node {
  background: #424242;
  border-color: #616161;
  color: white;
}

.v-theme--dark .node-content h4,
.v-theme--dark .node-content h5,
.v-theme--dark .node-content p {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.v-theme--dark .visual-node.connected {
  background: linear-gradient(135deg, #424242 0%, #2e7d2e 100%);
}

.v-theme--dark .model-node.connected {
  background: linear-gradient(135deg, #424242 0%, #1565C0 100%);
}

.v-theme--dark .schedule-node.connected {
  background: linear-gradient(135deg, #424242 0%, #6A1B9A 100%);
}

.v-theme--dark .prompt-node.connected {
  background: linear-gradient(135deg, #424242 0%, #00838F 100%);
}

.v-theme--dark .tools-node.connected {
  background: linear-gradient(135deg, #424242 0%, #E65100 100%);
}

.v-theme--dark .resources-node.connected {
  background: linear-gradient(135deg, #424242 0%, #2E7D32 100%);
}

.v-theme--dark .conversations-node.connected {
  background: linear-gradient(135deg, #424242 0%, #00695C 100%);
}

/* Agent Toggle Switch Styles */
.agent-toggle-switch {
  flex: none !important;
  margin: 0 !important;
  min-width: auto !important;
}

.agent-toggle-switch .v-switch__thumb {
  transition: all 0.3s ease;
}

.agent-toggle-switch .v-switch__track {
  background-color: #ff5722 !important;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.agent-toggle-switch.v-input--is-focused .v-switch__track,
.agent-toggle-switch:hover .v-switch__track {
  opacity: 0.7;
}

.agent-toggle-switch .v-selection-control--is-selected .v-switch__track {
  background-color: #4caf50 !important;
  opacity: 0.8;
}

.agent-toggle-switch .v-selection-control--is-selected:hover .v-switch__track,
.agent-toggle-switch .v-selection-control--is-selected.v-input--is-focused .v-switch__track {
  opacity: 1;
}

.agent-toggle-switch .v-switch__thumb {
  background-color: white !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.agent-toggle-switch .v-selection-control--is-selected .v-switch__thumb {
  background-color: white !important;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Dark theme support for toggle switch */
.v-theme--dark .agent-toggle-switch .v-switch__thumb {
  background-color: #f5f5f5 !important;
}

.v-theme--dark .agent-toggle-switch .v-switch__track {
  background-color: #d32f2f !important;
}

.v-theme--dark .agent-toggle-switch .v-selection-control--is-selected .v-switch__track {
  background-color: #388e3c !important;
}

/* Agent runtime status styling */
.agent-node .status-chips {
  gap: 4px;
}

.agent-node .runtime-info {
  font-size: 10px;
  line-height: 1.2;
}

.agent-node .runtime-info .v-icon {
  font-size: 10px !important;
}

/* Regular agent builder runtime status */
.agent-runtime-status {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 8px;
  margin-top: 8px;
}

.v-theme--dark .agent-runtime-status {
  background: rgba(255, 255, 255, 0.02);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .visual-node {
    width: 140px;
    padding: 12px;
  }
  
  .agent-node {
    width: 160px;
  }
  
  .node-content h4, .node-content h5 {
    font-size: 14px;
  }
  
  .node-content p {
    font-size: 11px;
  }
  
  .agent-toggle-switch {
    transform: scale(0.8);
  }
  
  .agent-node .runtime-info {
    font-size: 9px;
  }
  
  .agent-node .status-chips .v-chip {
    font-size: 8px !important;
  }
}

/* Chat dialog tool toggle */
.chat-tools-toggle {
  margin: 0 !important;
  padding: 0 !important;
}

.chat-tools-toggle .v-label {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.6);
}

.v-theme--dark .chat-tools-toggle .v-label {
  color: rgba(255, 255, 255, 0.7);
}