/**
 * ToolGrid AI Mode Styles
 * Styling for AI-powered interfaces and workspaces
 */

/* AI Workspace Styles */
.tg-ai-workspace {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.tg-workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
}

.tg-expert-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tg-expert-icon {
  width: 40px;
  height: 40px;
  background: #FF6B00;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.tg-expert-info {
  display: flex;
  flex-direction: column;
}

.tg-expert-name {
  font-weight: 700;
  color: #0A2540;
  font-size: 15px;
}

.tg-expert-status {
  font-size: 12px;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tg-expert-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
}

/* Mode toggle removed - AI-only platform */

.tg-ai-native-workspace {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.tg-workspace-body {
  display: flex;
  flex-direction: column;
  min-height: 500px;
}

.tg-chat-history {
  flex: 1;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
}

.tg-chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.tg-chat-msg.assistant {
  align-self: flex-start;
  background: #F3F4F6;
  color: #0A2540;
  border-bottom-left-radius: 2px;
}

.tg-chat-msg.user {
  align-self: flex-end;
  background: #0A2540;
  color: white;
  border-bottom-right-radius: 2px;
}

.tg-chat-msg.system {
  align-self: center;
  max-width: 95%;
  width: 100%;
}

.tg-chat-msg.error {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.tg-chat-input-wrap {
  padding: 20px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tg-suggested-prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-suggested-prompts p {
  margin: 0;
  font-size: 12px;
  color: #6B7280;
  font-weight: 600;
}

.tg-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tg-prompt-chip {
  padding: 6px 12px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 20px;
  font-size: 12px;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.2s;
}

.tg-prompt-chip:hover {
  border-color: #FF6B00;
  color: #FF6B00;
  background: rgba(255, 107, 0, 0.05);
}

.tg-advice-panel {
  padding: 0 20px 20px 20px;
  background: #F9FAFB;
}

.tg-best-practices {
  margin-top: 24px;
  padding: 20px;
  background: #F0F9FF;
  border-radius: 12px;
  border: 1px solid #BAE6FD;
}

.tg-best-practices h3 {
  margin-top: 0;
  color: #0369A1;
  font-size: 18px;
}

.tg-best-practices ul {
  margin-bottom: 0;
}

.tg-faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tg-faq-item {
  padding-bottom: 16px;
  border-bottom: 1px solid #E5E7EB;
}

.tg-faq-item:last-child {
  border-bottom: none;
}

.tg-faq-item strong {
  display: block;
  margin-bottom: 4px;
  color: #0A2540;
}

.tg-faq-item p {
  margin: 0;
  font-size: 14px;
  color: #4B5563;
}

/* AI Mode Container */
.tg-ai-mode-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI Mode Panel */
.tg-ai-mode-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Manual Mode Panel */
.tg-manual-mode-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI Explanation */
.tg-ai-explanation {
  padding: 12px 16px;
  background-color: rgba(255, 107, 0, 0.05);
  border-left: 4px solid #FF6B00;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #0A2540;
}

.tg-ai-explanation p {
  margin: 0;
}

/* PDF Workspace */
.tg-pdf-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tg-pdf-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  border: 2px dashed #E5E7EB;
  border-radius: 12px;
  background-color: #F9FAFB;
  transition: all 200ms ease-in-out;
  cursor: pointer;
}

.tg-pdf-upload-zone:hover {
  border-color: #FF6B00;
  background-color: rgba(255, 107, 0, 0.02);
}

.tg-pdf-upload-icon {
  font-size: 48px;
}

.tg-pdf-upload-zone h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #0A2540;
}

.tg-pdf-upload-zone p {
  margin: 0;
  font-size: 14px;
  color: #6B7280;
}

/* PDF File List */
#pdf-file-list h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #0A2540;
}

/* Calculator AI Mode */
.tg-calculator-ai-mode {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tg-calculator-manual-mode {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* AI Result Panel */
#ai-result-panel,
#calc-ai-result,
#pdf-ai-result {
  animation: slideIn 300ms ease-out;
}

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

/* AI Error Panel */
#ai-error-panel,
#calc-ai-error,
#pdf-error {
  animation: slideIn 300ms ease-out;
}

/* Loading State */
.tg-loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #E5E7EB;
  border-top-color: #FF6B00;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Button Small Variant */
.tg-btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-family: var(--tg-font-family);
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background-color: #FF6B00;
  color: white;
  cursor: pointer;
  transition: all 150ms ease-in-out;
  white-space: nowrap;
}

.tg-btn-small:hover {
  background-color: #E55A00;
  transform: translateY(-1px);
}

.tg-btn-small:active {
  transform: translateY(0);
}

/* AI Mode Badge */
.tg-ai-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: rgba(255, 107, 0, 0.1);
  color: #FF6B00;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* Mode Toggle Buttons */
.tg-mode-toggle {
  display: flex;
  gap: 8px;
  background-color: #F9FAFB;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
}

.tg-mode-btn {
  flex: 1;
  padding: 10px 12px;
  background-color: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #6B7280;
  transition: all 150ms ease-in-out;
  font-size: 13px;
}

.tg-mode-btn:hover {
  background-color: rgba(255, 107, 0, 0.05);
  color: #FF6B00;
}

.tg-mode-btn.active {
  background-color: white;
  color: #FF6B00;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .tg-pdf-upload-zone {
    padding: 30px 16px;
  }

  .tg-pdf-upload-icon {
    font-size: 36px;
  }

  .tg-pdf-upload-zone h3 {
    font-size: 16px;
  }

  .tg-mode-toggle {
    flex-direction: column;
  }

  .tg-mode-btn {
    width: 100%;
  }

  .tg-btn-small {
    width: 100%;
  }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
  .tg-pdf-upload-zone {
    background-color: rgba(255, 107, 0, 0.05);
    border-color: rgba(255, 107, 0, 0.2);
  }

  .tg-mode-toggle {
    background-color: rgba(255, 107, 0, 0.05);
    border-color: rgba(255, 107, 0, 0.2);
  }

  .tg-mode-btn.active {
    background-color: rgba(255, 107, 0, 0.15);
  }
}
