@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

body {
  font-family: 'IBM Plex Sans', sans-serif;
  margin: 0;
  display: flex;
  height: 100vh;
  background: #f4f4f4;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #25d366;
  border-radius: 10px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
  background: #1db954;
}

#user-sidebar {
  width: 500px;
  background: #075e54;
  color: white;
  padding: 15px;
  overflow-y: auto;
  flex-shrink: 0;
}
#user-sidebar h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#search-bar input {
  width: calc(100% - 30px);
  padding: 12px;
  font-size: 14px;
  border: none;
  border-radius: 25px;
  outline: none;
  background: white;
  display: block;
  margin: 0 auto;
}

.user-info {
  display: flex;
  flex-direction: column;
}
.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  margin: 8px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease-in-out;
  background: #084C41;
}
.user-item.auto-reply-active {
  outline: 2px solid #25d366;
  box-shadow: 0 0 5px rgba(37, 211, 102, 0.7);
}
.user-item.auto-reply-active .username {
  position: relative;
  padding-right: 26px; 
}

.user-item.auto-reply-active .username::after {
  content: "autorenew";            
  font-family: 'Material Icons';   
  font-size: 18px;       
  color: #8d8d8d;                             
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.username {
  font-size: 16px;
  font-weight: bold;
  color: white;
}
.last-message {
  font-size: 14px;
  color: #ffffffe8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.user-item.has-new-message::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #ff3c3c;
  border-radius: 50%;
}
.user-item:hover,
.user-item.selected {
  background: rgba(37, 211, 102, 0.2);
  color: white;
}

#chat-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  flex: 1;
  height: 100vh;
  overflow: hidden;
}

#chat-header {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #075e54;
  color: white;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  display: none;
}

#chat-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  opacity: 0.7;
}

#chat-placeholder img {
  max-width: 350px;
  width: 60%;
  height: auto;
}

#chat-placeholder p {
  font-size: 16px;
  color: #777;
  margin-top: 10px;
}

#chat-box, #message-input {
  display: none;
}
.chat-active #chat-header,
.chat-active #message-input {
  display: flex;
}
.chat-active #chat-placeholder {
  display: none;
}
.chat-active #chat-box {
  display: flex;
}

#chat-box {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid #ccc;
  min-height: 100px;
}
.message {
  padding: 12px 18px;
  margin: 6px 0;
  border-radius: 15px;
  max-width: 65%;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}
.message.user {
  background: #dcf8c6;
  align-self: flex-start;
  border-top-left-radius: 0;
}
.message.assistant {
  background: #ece5dd;
  align-self: flex-end;
  border-top-right-radius: 0;
  margin-left: auto;
}

#message-input {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f6f6f6;
  border-top: 1px solid #ddd;
  box-sizing: border-box;
  flex-shrink: 0;
  display: none;
}
#message-input input {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  border: none;
  border-radius: 25px;
  outline: none;
  background: white;
}
#message-input button {
  margin-left: 10px;
  padding: 8px 15px;
  background: linear-gradient(135deg, #25d366, #128C7E);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 40px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}
#message-input button:hover {
  background: linear-gradient(135deg, #1db954, #0f6c52);
  transform: scale(1.05);
}

.timestamp_chat {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  color: #666;
  text-align: right;
}
.timestamp_user {
  font-size: 12px;
  color: #dad8d8;
  text-align: right;
}


.message-info {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

#run-info-panel {
  position: absolute;
  right: 0;
  top: 60px;
  width: 320px;
  height: calc(100% - 60px);
  background-color: #fff;
  border-left: 1px solid #ccc;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 999;
  display: none;  
  overflow-y: auto;
}
#run-info-panel.visible {
  display: block;
}

#close-run-panel {
  background-color: #ccc;
  border: none;
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  float: right; 
  margin-bottom: 10px;
}
#close-run-panel:hover {
  background-color: #bbb;
}

#run-info-panel h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #075e54;
  font-size: 18px;
  font-weight: bold;
  clear: both; 
}

#run-info-content {
  display: flex;
  flex-direction: column;
  gap: 16px; 
  margin-top: 10px;
}

.run-detail-box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: border-color 0.2s ease;
}
.run-detail-box:hover {
  border-color: #25d366;
}
.run-detail-box .title {
  font-weight: 600;
  font-size: 15px;
  color: #075e54;
  margin-bottom: 8px;
}
.run-detail-box .info-line {
  margin-bottom: 5px;
  font-size: 14px;
  color: #333;
}
.run-detail-box .info-line strong {
  color: #555;
}
.run-group {
  position: relative;
  margin: 10px 0;
  padding: 0 20px;
  border-right: 3px solid #999;
}

.run-group-messages {
  display: flex;
  flex-direction: column;
  margin-right: 30px;
}

.run-toggle-button {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: color 0.2s ease;
}
.run-toggle-button::before {
  content: "»";
  display: inline-block;
}
.run-toggle-button:hover {
  color: #25d366;
}

.function-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 10px;
  transition: border-color 0.2s ease;
}
.function-card:hover {
  border-color: #25d366;
}
.function-card h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #075e54;
  font-weight: 600;
}

.function-status {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  margin-left: 5px;
  color: #fff;
}
.function-status.success {
  background: #25d366;
}
.function-status.error {
  background: #e74c3c;
}
.function-status.pending {
  background: #f1c40f;
  color: #333;
}

.function-card p strong {
  color: #555;
}

.function-code-block {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 6px 8px;
  font-size: 13px;
  font-family: "Courier New", Courier, monospace;
  white-space: pre-wrap; 
  word-wrap: break-word; 
  margin-bottom: 8px;
}

.day-separator {
  text-align: center;
  margin: 10px 0;
  font-size: 12px;
  font-weight: bold;
  color: #777;
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px solid #ccc;
}
.day-container {
  margin-bottom: 20px;
}

#toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #25d366;
}
input:checked + .slider:before {
  transform: translateX(14px);
}

.bar-locked {
  background-color: #eee !important;
  pointer-events: none; 
  opacity: 0.8;
}

.bar-locked a {
  pointer-events: auto;
  text-decoration: underline; 
  color: #007bff; 
}

.bar-locked input {
  background-color: #cccccc !important;
}


.message-status {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.status-icon {
  font-size: 18px;
  margin-left: 2px;
}


.delivered-icon {
  color: grey;
}


.received-icon {
  color: grey;
}


.read-icon {
  color: blue;
}


.failed-icon {
  color: red;
}
