#widget-header {
  display: flex;
  background: #202123;
  justify-content: space-between;
  height: 35px;
}

#tab-bar {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  background: #202123;
}

#ticket-number {
  font-size: 12px;
  border-bottom: 1px solid #19c37d;
}

.tab-button {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 140px;
  background: #202123;
  border: none;
  border-radius: 8px 8px 0px 0px;
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.tab-button.active {
  background: #343541;
  color: #19c37d;
}

.tab-button:hover {
  background: #3a3b44;
}

.tab-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#widget-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px;
  gap: 6px;
  flex-shrink: 0;
}

#widget-controls button {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #ccc;
  padding: 0 10px;
}

#widget-controls button:hover {
  color: #fff;
}

#chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #343541;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  min-height: 0;
  font-variant-ligatures: none; /* Prevent weird character combinations */
  text-rendering: optimizeLegibility;
}

.history {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  /* border-bottom: 1px solid #555; */
  font-size: 12px;
  min-height: 0;
  line-height: 1.4;
}

#analyze-container {
  margin: 10px;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#analyze-container-action button {
  margin: 15px;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  width: 200px;
}

.analyze-icon {
  margin-right: 5px;
}

#message-container {
  padding: 6px 12px 8px 12px;
  background: #40414f;
  border-top: 1px solid #555;
  max-height: 50px;
}

#message-container-info {
  display: flex;
  color: #ffc107;
  font-size: 12px;
  padding-bottom: 6px;
}

#message-container-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 100%;
}

textarea {
  flex-grow: 1;
  resize: none;
  height: 30px;
  background: #40414f;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 0.8;
  overflow-y: hidden;
  box-sizing: border-box;
  min-height: 30px;
  max-height: 30px;
}

button {
  background: #19c37d;
  color: white;
  border: none;
  padding: 0 16px;
  font-size: 12px;
  /* height: 36px; */
  line-height: 30px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
}

button:hover {
  background: #15a86b;
}

/* Message Styling */
.message {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 4px solid #555;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.message-content {
  margin-left: 8px;
  word-wrap: break-word;
  unicode-bidi: embed;
  direction: ltr;
  white-space: pre-wrap;
  font-variant-ligatures: none;
  text-rendering: optimizeLegibility;
}

.timestamp {
  font-size: 11px;
  color: #888;
  font-weight: normal;
}

/* Different message types */
.chat-message {
  background: #444654;
  border-left-color: #19c37d;
}

.agent-message {
  background: #444654;
  border-left-color: #4a9eff;
}

.ai-response-message {
  background: #3d4a3d;
  border-left-color: #19c37d;
  font-weight: 500;
}

.status-message {
  background: #2a2d3a;
  border-left-color: #ffa500;
  font-style: italic;
}

.error-message {
  background: #3d2a2a;
  border-left-color: #ff4444;
}

.analysis-message {
  background: #2a3d2a;
  border-left-color: #19c37d;
}

.info-message {
  background: #2a2a3d;
  border-left-color: #4a9eff;
}

.reference-message {
  background: #3d2a2a;
  border-left-color: #ff4444;
}

.prompt-message {
  background: #3d3a2a;
  border-left-color: #f59e0b;
}

/* Dashboard Message Styling */
.dashboard {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-size: 12px;
  line-height: 1.4;
}

.dashboard-row {
  display: flex;
  width: 100%;
  gap: 10px;
}

.dashboard-row > div {
  display: flex;
  flex-direction: column;
}

.dashboard-message {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 4px solid #555;
  height: 100%;
}

.dashboard-message-row .dashboard-message {
  background: #0f2937;
  border-left-color: #00dbff;
}

/* Quick Actions Styling */
.quick-actions {
  position: relative;;
}

#tooltip-button {
  padding: 0px;
  width: 25px;
}

#quick-actions-tooltip {
  position: absolute;
  width: 160px;
  bottom: 100%;
  right: 0%;
  background: #19c37d;
  color: white;
  padding: 5px 5px;
  border-radius: 8px;
  margin-bottom: 12px;
  word-wrap: break-word;
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  align-items: flex-start;
}

#quick-actions-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 7px;
  border-width: 8px;
  border-style: solid;
  border-color: #19c37d transparent transparent transparent;
}

.quick-actions-tooltip-header {
  width: 157px;
}

.quick-actions-tooltip-header > fieldset {
  border: none;
  border-top: 1px solid #ccc;
  text-align: left;
  padding-top: 3px;
  padding-bottom: 0px;
  margin-top: 10px;
}

.quick-actions-tooltip-header > fieldset > legend {
  padding: 0 5px;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
}

.quick-btn {
  width: 100%;
  color: white;
  border: none;
  padding: 4px 10px;
  margin: 2px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  font-weight: 500;
  text-align: left;
}

/* Scrollbar styling */
.history::-webkit-scrollbar {
  width: 6px;
}

.history::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.history::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.history::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Responsive adjustments */
@media (max-width: 350px) {
  #message-container {
    padding: 8px;
  }

  .message {
    padding: 6px 8px;
    margin-bottom: 8px;
  }

  textarea {
    font-size: 12px;
  }

  button {
    padding: 0 12px;
    font-size: 13px;
  }
}

/* Animation for new messages */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  animation: slideIn 0.3s ease-out;
}

/* Loading indicator for status messages */
.status-message .message-content:after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffa500;
  margin-left: 8px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.action-container {
  display: flex;
  padding: 6px 16px 6px 16px;
  max-height: 50px;
  gap: 8px;
}

/* Login Form Styles */
#login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 20px;
}

#login-form {
  background: #40414f;
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #555;
  text-align: center;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#login-form h3 {
  color: #ffffff;
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 600;
}

#login-form p {
  color: #d1d5db;
  margin: 0 0 20px 0;
  font-size: 14px;
}

#login-form input[type="text"],
#login-form input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #343541;
  border: 1px solid #555;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  box-sizing: border-box;
}

#login-form input[type="text"]:focus,
#login-form input[type="password"]:focus {
  outline: none;
  border-color: #19c37d;
}

#login-button {
  width: 100%;
  margin-top: 8px;
  height: 40px;
  line-height: 40px;
  font-size: 15px;
}

#login-error {
  font-size: 13px;
  padding: 8px;
  background: rgba(255, 68, 68, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

#chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#version {
  color: #ffffff;
  font-size: 6px;
  text-align: end;
}

.tab-loading {
  font-size: 12px;
  align-content: center;
}

.tab-loading::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffa500;
  margin-left: 8px;
  animation: pulse 1.5s infinite;
}