/* Chatbot Container Styles */
.chatbot-container {
  max-width: 1000px;
  margin: 2rem auto;
  background: var(--card-bg);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* Language Selector Styles */
.language-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: 0.5rem;
  border: 2px solid var(--primary);
}

.language-selector label {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.language-selector select {
  flex: 1;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.language-selector select:hover {
  border-color: var(--primary);
}

.language-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Chat Input Group Styles */
.chat-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chat-input-group input {
  flex: 1;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card-bg);
  color: var(--text);
  transition: all 0.3s ease;
}

.chat-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Voice Button Styles */
.voice-btn,
.submit-btn {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--primary);
  border-radius: 0.5rem;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.voice-btn:hover,
.submit-btn:hover {
  background: var(--primary-dark, #388e3c);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.voice-btn:active,
.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

/* Recording Animation */
.voice-btn.recording {
  background: #e53935;
  border-color: #c62828;
  animation: pulse-recording 1s infinite;
}

.voice-btn.recording::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #e53935;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-recording {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(229, 57, 53, 0);
  }
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Voice Status Styles */
.voice-status {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.voice-status.info {
  background: rgba(33, 150, 243, 0.1);
  border-left: 4px solid #2196F3;
  color: #1976D2;
}

.voice-status.listening {
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid #4CAF50;
  color: #2E7D32;
  animation: pulse-text 1.5s infinite;
}

.voice-status.error {
  background: rgba(229, 57, 53, 0.1);
  border-left: 4px solid #E53935;
  color: #C62828;
}

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

/* Recognized Text Display */
.recognized-text {
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid #4CAF50;
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
  animation: slideIn 0.3s ease;
}

#recognized-content {
  color: #2E7D32;
  font-weight: 500;
}

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

/* Response Content Styles */
.chat-response-content {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

/* Table Styles */
.table-responsive {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

.chat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: var(--bg-alt);
}

.chat-table th,
.chat-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border: 1px solid var(--border);
}

.chat-table th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.chat-table tr:nth-child(even) {
  background: var(--card-bg);
}

.chat-table tr:hover {
  background: var(--card-hover);
}

/* List Styles */
.chat-list,
.chat-ordered-list {
  margin: 1rem 0;
  padding-left: 2rem;
}

.chat-list li,
.chat-ordered-list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Code and Measurement Styles */
.chat-code {
  background: var(--bg-alt);
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-family: monospace;
  color: var(--primary);
  font-size: 0.9rem;
}

/* Highlighted Terms */
.highlight {
  color: var(--primary);
  font-weight: 600;
}

/* Loading State */
.thinking {
  color: var(--accent);
  font-weight: 500;
  animation: pulse 1.5s infinite;
}

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

/* Error State */
.chat-error {
  color: #e53935;
  font-weight: 500;
}

/* Spacing and Typography */
.chat-response-content > * + * {
  margin-top: 1rem;
}

.chat-response-content h2,
.chat-response-content h3 {
  color: var(--primary);
  margin: 1.5rem 0 1rem;
  font-weight: 600;
}

.chat-response-content p {
  margin: 0.8rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-container {
    margin: 1rem;
    padding: 1rem;
  }

  .chat-table {
    font-size: 0.9rem;
  }

  .chat-table th,
  .chat-table td {
    padding: 0.6rem 0.8rem;
  }
}