/* 1. Variables */
:root {
  --tmch-primary: #001f3d;
  --tmch-primary-gradient: linear-gradient(135deg, #001f3d 0%, #002a52 100%);
  --tmch-accent: #68C13E;
  --tmch-accent-hover: #4ba820;
  --tmch-accent-gradient: linear-gradient(135deg, #68C13E, #4ba820);
  --tmch-white: #fff;
  --tmch-border-subtle: rgba(0, 0, 0, 0.04);
  --tmch-bg-light: #f0f2f5;
  --tmch-shadow-lg: 0 12px 48px rgba(0,0,0,0.15);
  --tmch-shadow-md: 0 8px 24px rgba(137, 195, 75, 0.35);
  --tmch-font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tmch-z-index: 2147483647; /* Max safe integer to ensure overlay */
}

/* Preview page helper (used by index.html only) */
.tmch-preview-page {
  background-color: var(--tmch-primary);
  margin: 0;
}


#tmch-chatbot-interface {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: var(--tmch-z-index);
  font-family: var(--tmch-font-stack);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

/* RTL Support (Arabic) */
#tmch-chatbot-interface.rtl {
  right: auto;
  left: 20px;
  align-items: flex-start;
}

#tmch-chatbot-interface.rtl #chatbot-launcher {
  right: auto;
  left: 0;
  transform-origin: bottom left;
  flex-direction: row-reverse;
}

#tmch-chatbot-interface.rtl #chatbot-window {
  right: auto;
  left: 0;
  transform-origin: bottom left;
}

#tmch-chatbot-interface.rtl .chatbot-header {
  flex-direction: row-reverse;
}

#tmch-chatbot-interface.rtl #chatbot-send-btn {
  transform: scaleX(-1); /* Flip the send arrow */
}

/* 3. Components */
#chatbot-launcher {
  height: 56px;
  width: 56px;
  padding: 0;
  background: var(--tmch-accent-gradient);
  border: 1px solid rgba(104, 193, 62, 0.3);
  border-radius: 50%;
  box-shadow: var(--tmch-shadow-md);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  position: absolute;
  bottom: 0;
  right: 0;
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

#chatbot-launcher:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(104, 193, 62, 0.4);
  border-color: rgba(104, 193, 62, 0.5);
}

#chatbot-launcher:active {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(104, 193, 62, 0.35);
}

#chatbot-launcher svg {
  stroke: #fff;
}

#chatbot-launcher.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

#chatbot-window {
  width: 380px;
  height: 600px;
  max-height: 80vh;
  background-color: var(--tmch-white);
  border-radius: 24px;
  box-shadow: var(--tmch-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tmch-border-subtle);
  transform-origin: bottom right;
  position: absolute;
  bottom: 0;
  right: 0;
  pointer-events: auto;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

#chatbot-window.hidden {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

#tmch-chatbot-interface .chatbot-header {
  background: var(--tmch-primary-gradient) !important;
  color: #fff !important;
  padding: 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

#tmch-chatbot-interface .header-title {
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  letter-spacing: -0.02em !important;
  color: #fff !important;
}

#tmch-chatbot-interface .header-actions {
  display: flex !important;
  gap: 6px !important;
  align-items: center !important;
}

#tmch-chatbot-interface .header-icon-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  color: white !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  font-size: inherit !important;
  line-height: 1 !important;
}

#tmch-chatbot-interface .header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  transform: translateY(-1px) !important;
  color: white !important;
}

#tmch-chatbot-interface .header-icon-btn:active {
  transform: translateY(0) !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

#tmch-chatbot-interface .header-icon-btn svg {
  stroke: currentColor !important;
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
}

/* 4. Messages */
#chatbot-messages {
  flex: 1;
  padding: 20px;
  background-color: #ffffff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#tmch-chatbot-interface .message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  opacity: 0;
  animation: messageSlideUp 0.3s ease-out forwards;
}

#tmch-chatbot-interface .bot-message-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  align-self: flex-start;
  max-width: 85%;
  opacity: 0;
  animation: messageSlideUp 0.3s ease-out forwards;
}

#tmch-chatbot-interface .bot-message-wrapper:has(.contact-card) {
  max-width: 96%;
}

.bot-avatar {
  width: 36px;
  height: 36px;
  background: var(--tmch-primary-gradient);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 31, 61, 0.2);
}

.bot-avatar svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

#tmch-chatbot-interface .bot-message {
  background-color: transparent !important;
  padding: 6px 0 !important;
  color: #050505 !important;
  align-self: auto !important;
  max-width: 100% !important;
}

#tmch-chatbot-interface .user-message {
  background-color: var(--tmch-primary) !important;
  color: #fff !important;
  align-self: flex-end;
  max-width: 100% !important;
  border-top-right-radius: 18px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 31, 61, 0.15);
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
}

/* User message wrapper — aligns bubble + edit button to the right */
.user-message-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-end;
  max-width: 85%;
}

/* Edit button row shown on hover */
.user-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.25s ease, max-height 0.25s ease, margin-top 0.25s ease;
}

.user-message-wrapper:hover .user-message-actions {
  opacity: 1;
  max-height: 40px;
  margin-top: 4px;
}

.edit-msg-btn:hover {
  color: #4A90E2;
  background-color: #eaf4ff;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

/* Reset animation for messages inside wrapper */
#tmch-chatbot-interface .bot-message-wrapper .message {
  animation: none !important;
  opacity: 1 !important;
}

/* Bot message content formatting */
#tmch-chatbot-interface .bot-message p {
  margin: 0 0 12px 0 !important;
  line-height: 1.6 !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  color: #050505 !important;
  background: none !important;
}

#tmch-chatbot-interface .bot-message p:last-child {
  margin-bottom: 0 !important;
}

#tmch-chatbot-interface .bot-message strong {
  font-weight: 600;
  color: var(--tmch-primary);
}

#tmch-chatbot-interface .bot-message em {
  font-style: italic;
}

.bot-message ul.bot-list {
  margin: 8px 0;
  padding-left: 0;
  list-style: none;
}

.bot-message ul.bot-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.bot-message ul.bot-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--tmch-accent);
  border-radius: 50%;
}

.bot-message ul.bot-list li:last-child {
  margin-bottom: 0;
}

/* Numbered lists */
.bot-message ol.bot-numbered-list {
  margin: 8px 0;
  padding-left: 24px;
  list-style: decimal;
}

.bot-message ol.bot-numbered-list li {
  padding-left: 8px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.bot-message ol.bot-numbered-list li::marker {
  font-weight: 600;
  color: var(--tmch-accent);
}

.bot-message ol.bot-numbered-list li:last-child {
  margin-bottom: 0;
}

/* Callout / note blocks (**Note:**, **Important:**, **Critical requirement:**, etc.) */
.bot-message .bot-callout {
  background: rgba(0, 82, 155, 0.06);
  border-left: 3px solid var(--tmch-accent);
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  margin: 10px 0;
}

.bot-message .bot-callout p {
  margin: 0 !important;
}

/* Horizontal rule divider rendered from --- in markdown */
.bot-message hr.bot-divider {
  border: none;
  border-top: 1px solid rgba(0, 40, 85, 0.15);
  margin: 12px 0;
}

/* Standalone bold section labels: **Who can apply?**, **Key points:**, etc. */
.bot-message p.bot-section-label {
  font-weight: 600;
  color: var(--tmch-primary);
  margin: 14px 0 4px 0 !important;
}

.bot-message p.bot-section-label:first-child {
  margin-top: 0 !important;
}

/* Standalone bold section labels: **Who can apply?**, **Key points:**, etc. */
.bot-message p.bot-section-label {
  font-weight: 600;
  color: var(--tmch-primary);
  margin: 14px 0 4px 0 !important;
}

.bot-message p.bot-section-label:first-child {
  margin-top: 0 !important;
}

/* Nested bullet lists inside numbered lists */
.bot-message ul.bot-nested-list {
  margin: 6px 0 4px 0;
  padding-left: 0;
  list-style: none;
}

.bot-message ul.bot-nested-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 4px;
  line-height: 1.5;
  font-size: 0.95em;
}

.bot-message ul.bot-nested-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  background: var(--tmch-accent);
  border-radius: 50%;
  opacity: 0.8;
}

.bot-message ul.bot-nested-list li:last-child {
  margin-bottom: 0;
}

/* Headings */
.bot-message h3.bot-heading,
.bot-message h4.bot-heading,
.bot-message h5.bot-heading {
  margin: 16px 0 10px 0;
  font-weight: 600;
  color: var(--tmch-primary);
  line-height: 1.3;
}

.bot-message h3.bot-heading {
  font-size: 1.1rem;
  margin-top: 20px;
}

.bot-message h4.bot-heading {
  font-size: 1.05rem;
  margin-top: 16px;
}

.bot-message h5.bot-heading {
  font-size: 1rem;
  margin-top: 14px;
}

.bot-message h3.bot-heading:first-child,
.bot-message h4.bot-heading:first-child,
.bot-message h5.bot-heading:first-child {
  margin-top: 0;
}

/* Tables */
.bot-message .bot-table-wrapper {
  overflow-x: auto;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--tmch-border, #e2e8f0);
}

.bot-message .bot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 280px;
}

.bot-message .bot-table th {
  background: var(--tmch-primary);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.bot-message .bot-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--tmch-border, #e2e8f0);
  line-height: 1.4;
}

.bot-message .bot-table tr:last-child td {
  border-bottom: none;
}

.bot-message .bot-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.025);
}

/* Message Actions (Copy, Feedback, Regenerate) */
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(5px);
}

.bot-message-wrapper:hover .message-actions {
  opacity: 1;
  max-height: 50px;
  margin-top: 8px;
  transform: translateY(0);
}

.action-btn {
  background: #f0f2f5;
  border: 1px solid transparent;
  border-radius: 50%; /* Fully rounded */
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #5f6368;
  width: 32px;
  height: 32px;
  position: relative;
}

.action-btn:hover {
  background: #fff;
  color: var(--tmch-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.action-btn:active {
  transform: scale(0.95);
  background: #e8eaed;
}

/* Specific colors for each button */
.copy-btn:hover {
  color: #4A90E2; /* Blue */
  background-color: #eaf4ff;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.feedback-up:hover, .feedback-up.active {
  color: #2ecc71; /* Green */
  background-color: #ebfbf2;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.2);
}

.feedback-down:hover, .feedback-down.active {
  color: #e74c3c; /* Red */
  background-color: #fdedeb;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}


.action-btn svg {
  stroke: currentColor;
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

/* Tooltip on hover */
.action-btn::after {
  content: attr(aria-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
  margin-bottom: 4px;
}

.action-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.action-btn.copied {
  color: var(--tmch-accent);
  background: rgba(104, 193, 62, 0.1);
}

.action-btn.copied svg {
  stroke: currentColor;
}

.feedback-btn.active {
  color: var(--tmch-accent);
  background: rgba(104, 193, 62, 0.1);
}

.feedback-btn.active svg {
  stroke: currentColor;
  fill: currentColor;
}

/* 5. Input Area */
.chatbot-input-area {
  padding: 16px;
  background-color: var(--tmch-white);
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 12px;
  align-items: center;
}

#chatbot-input {
  flex: 1;
  padding: 12px 16px;
  background-color: var(--tmch-bg-light);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 24px;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

#chatbot-input:focus {
  background-color: #fff;
  border-color: var(--tmch-accent);
  box-shadow: 0 0 0 3px rgba(104, 193, 62, 0.08);
}

#chatbot-input:disabled {
  background-color: #f9f9f9;
  cursor: not-allowed;
}

#chatbot-send-btn {
  background: var(--tmch-accent-gradient);
  color: white;
  border: 1px solid rgba(104, 193, 62, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(104, 193, 62, 0.25);
}

#chatbot-send-btn:hover {
  background: var(--tmch-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(104, 193, 62, 0.35);
  border-color: rgba(104, 193, 62, 0.5);
}

#chatbot-send-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(104, 193, 62, 0.3);
}

#chatbot-send-btn:disabled {
  background-color: #d0d0d0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#chatbot-send-btn svg {
  stroke: currentColor;
  fill: none;
}

/* 6. Animations */
@keyframes messageSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 0;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #888;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Suggestion Chips (Part of Messages) */
#chatbot-suggestions-container {
  display: flex;
  flex-wrap: wrap; /* Allow chips to wrap to next row */
  align-items: center;
  justify-content: flex-start; /* Center the chips */
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
  overflow: hidden;
  transition: all 0.3s ease;
  max-height: 0;
  opacity: 0;
}
#chatbot-suggestions-container::-webkit-scrollbar { 
  display: none; 
}
#chatbot-suggestions-container.visible {
  pointer-events: auto;
  padding: 10px 16px;
  max-height: 160px; /* Enough for 2 rows of wrapped chips */
  opacity: 1;
}

#tmch-chatbot-interface .suggestion-chip {
  background-color: #ffffff !important;
  border: 1px solid var(--tmch-accent) !important;
  color: var(--tmch-accent) !important;
  padding: 7px 14px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  flex: 0 1 auto !important;
  max-width: 100% !important;
  text-align: center !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  outline: none !important;
}

#tmch-chatbot-interface .suggestion-chip:hover {
  background-color: var(--tmch-accent) !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(104, 193, 62, 0.25) !important;
}

#tmch-chatbot-interface .suggestion-chip:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(104, 193, 62, 0.2) !important;
}

/* Status Messages (Searching) */
.searching-message {
  display: flex;
  align-items: center;
  gap: 10px;
  font-style: italic;
  color: #666;
  position: relative;
  overflow: hidden;
}
.searching-message::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.searching-icon{
  display: flex;
  align-items: center;
  color: var(--tmch-accent);
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Message Sources */
.message-sources {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sources-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #666;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
  font-weight: 500;
}

.sources-toggle:hover {
  color: var(--tmch-primary);
}

.sources-toggle .chevron {
  margin-left: auto;
  transition: transform 0.2s;
}

.sources-toggle.active .chevron {
  transform: rotate(180deg);
}

.sources-list {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

.sources-list.visible {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Inline citation links */
#tmch-chatbot-interface .citation-link {
  color: var(--tmch-accent) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
  font-weight: 600 !important;
  font-size: 0.9em !important;
  transition: all 0.2s ease;
  border-bottom: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

#tmch-chatbot-interface .citation-link:hover {
  color: var(--tmch-accent-hover) !important;
  text-decoration: underline !important;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--tmch-primary);
  background-color: rgba(0, 31, 61, 0.05);
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.source-link:hover {
  background-color: rgba(0, 31, 61, 0.1);
  transform: translateY(-1px);
}

.source-link svg {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

/* 7. Contact Card */
.contact-card {
  background: linear-gradient(135deg, rgba(0, 31, 61, 0.04) 0%, rgba(104, 193, 62, 0.07) 100%);
  border: 1px solid rgba(104, 193, 62, 0.3);
  border-radius: 16px;
  padding: 16px 16px; 
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

.contact-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #001f3d;
  padding-bottom: 4px;
}

.contact-card-header svg {
  flex-shrink: 0;
  stroke: var(--tmch-accent);
}

.contact-card-email-row,
.contact-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: #333;
  font-weight: 500;
  background: rgba(0, 31, 61, 0.06);
  padding: 10px 13px;
  border-radius: 10px;
  word-break: break-all;
}

.contact-card-email-row svg,
.contact-card-row svg {
  flex-shrink: 0;
  opacity: 0.55;
}

.contact-card-row-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--tmch-primary, #001f3d);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.contact-card-row-link:hover {
  color: var(--tmch-accent, #68c13e);
  text-decoration: underline;
}

.contact-card-row-link svg {
  flex-shrink: 0;
  opacity: 0.65;
}

/* ── Office hours block ──────────────────────────────────────── */
.contact-card-hours {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(0, 31, 61, 0.06);
  padding: 11px 13px;
  border-radius: 10px;
}

.contact-card-hours-icon {
  flex-shrink: 0;
  opacity: 0.55;
  margin-top: 2px;
}

.contact-card-hours-icon svg {
  display: block;
}

.contact-card-hours-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hours-days {
  font-size: 0.8rem;
  font-weight: 700;
  color: #001f3d;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hours-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.hours-slot {
  background: rgba(104, 193, 62, 0.12);
  color: #2e6e10;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.hours-sep {
  color: #aaa;
  font-size: 0.75rem;
  line-height: 1;
}

.hours-tz {
  font-size: 0.73rem;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: center;
}

.contact-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(104, 193, 62, 0.15);
  margin-top: 4px;
}

.contact-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--tmch-accent-gradient);
  border: 1px solid rgba(104, 193, 62, 0.3);
  color: #fff;
  padding: 8px 16px;
  border-radius: 18px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(104, 193, 62, 0.25);
}

.contact-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(104, 193, 62, 0.4);
  border-color: rgba(104, 193, 62, 0.5);
}

.contact-card-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(104, 193, 62, 0.3);
}

.contact-card-btn svg {
  stroke: #fff;
}

.contact-card-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  padding: 8px 16px;
  border-radius: 18px;
  border: 1px solid var(--tmch-accent, #68c13e);
  color: var(--tmch-accent, #68c13e);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-card-call-btn:hover {
  color: #4a9e28;
  text-decoration-color: #4a9e28;
}

.contact-card-call-btn svg {
  stroke: currentColor;
  flex-shrink: 0;
}

/* Ensure time and timezone stay on the same line */
.contact-card-time {
    white-space: nowrap;
    display: inline-block;
}

/* 8. Media Queries */
@media (max-width: 600px) {
  #chatbot-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}
