/* Technicks Chatbot Widget - Isolated Styles */
.tc-widget {
  position: fixed;
  top: auto;
  bottom: 20px;
  right: 20px;
  left: auto;
  inset: auto 20px 20px auto;
  margin: 0;
  transform: none;
  float: none;
  z-index: 100000;
  font-family: inherit;
  font-size: 14px;
}

.tc-launcher {

  background: linear-gradient(135deg, #FBC108 0%, #e5ad07 100%);
  color: #0f1026;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  box-shadow: 0 4px 12px rgba(251, 193, 8, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tc-launcher:hover,
.tc-launcher:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(251, 193, 8, 0.5);
  outline: 2px solid #0f1026;
  outline-offset: 2px;
}

.tc-panel {
  display: none;
  position: absolute !important;
  bottom: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  width: min(340px, calc(100vw - 24px)) !important;
  max-width: min(340px, calc(100vw - 24px)) !important;
  height: min(480px, calc(100dvh - 120px)) !important;
  max-height: min(480px, calc(100dvh - 120px)) !important;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(15, 16, 38, 0.1);
  box-sizing: border-box !important;
}

.tc-panel.is-open {
  display: flex;
}

.tc-header {
  background: linear-gradient(90deg, #0f1026 0%, #15182b 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tc-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tc-header-logo {
  height: 28px;
  width: auto;
}

.tc-header-title {
  font-weight: 600;
  font-size: 15px;
}

.tc-header-subtitle {
  font-size: 11px;
  opacity: 0.8;
}

.tc-header-actions {
  display: flex;
  gap: 6px;
}

.tc-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-icon-btn:hover,
.tc-icon-btn:focus {
  background: rgba(251, 193, 8, 0.3);
  outline: 2px solid #FBC108;
  outline-offset: 1px;
}

.tc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tc-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.tc-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #FBC108 0%, #e5ad07 100%);
  color: #0f1026;
  border-bottom-right-radius: 4px;
}

.tc-message.assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

.tc-link-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #25D366;
  color: white !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-weight: 600;
  margin: 6px 4px 6px 0;
  transition: background 0.2s ease;
  cursor: pointer;
}

.tc-link-btn:hover {
  background: #128C7E;
  color: white !important;
}

.tc-message.system {
  align-self: center;
  background: #e8f4fd;
  color: #0c5460;
  font-size: 12px;
  max-width: 90%;
}

.tc-typing {
  align-self: flex-start;
  display: none;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

.tc-typing.is-visible {
  display: flex;
}

.tc-typing-dot {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: tc-bounce 1.4s infinite ease-in-out;
}

.tc-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.tc-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes tc-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.tc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  background: #f9f9f9;
}

.tc-suggestion {
  background: #ffffff;
  border: 1px solid #ddd;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
}

.tc-suggestion:hover,
.tc-suggestion:focus {
  background: #f0f0f0;
  border-color: #FBC108;
  outline: 2px solid #FBC108;
  outline-offset: 1px;
}

.tc-input-area {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e0e0e0;
  background: #ffffff;
}

.tc-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  resize: none;
  max-height: 80px;
  font-family: inherit;
}

.tc-input:focus {
  outline: 2px solid #FBC108;
  outline-offset: 1px;
  border-color: #FBC108;
}

.tc-send {
  background: #FBC108;
  color: #0f1026;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tc-send:hover:not(:disabled),
.tc-send:focus:not(:disabled) {
  background: #e5ad07;
  outline: 2px solid #0f1026;
  outline-offset: 1px;
}

.tc-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tc-error {
  background: #f8d7da;
  color: #721c24;
  padding: 8px 12px;
  margin: 0 16px 10px;
  border-radius: 6px;
  font-size: 12px;
  display: none;
}

.tc-error.is-visible {
  display: block;
}

.tc-error-retry {
  background: #721c24;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
}

@media (max-width: 480px) {
  .tc-widget {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    right: max(12px, env(safe-area-inset-right, 12px));
    left: auto;
    inset: auto max(12px, env(safe-area-inset-right, 12px)) max(12px, env(safe-area-inset-bottom, 12px)) auto;
  }
  .tc-panel {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    height: calc(100dvh - 90px) !important;
    max-height: calc(100dvh - 90px) !important;
    bottom: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    border-radius: 14px;
  }
  .tc-launcher span {
    display: none !important;
  }
  .tc-launcher {
    width: 54px !important;
    height: 54px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }
  .tc-input {
    font-size: 16px !important;
  }
}
