/* Hide containers by default to prevent flash of unstyled content */
#whatflow-button-container, #whatflow-agent-modal, #whatflow-single-popup {
  display: none;
}

/* ---- UNIFIED HEADER STYLES ---- */
.whatflow-header {
  padding: 12px 16px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whatflow-header-info {
  display: flex;
  align-items: center;
  flex-grow: 1;
}

.whatflow-header-logo {
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  background-color: rgba(255,255,255,0.2);
}

.whatflow-header-text h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.whatflow-header-text span {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  display: block;
  margin-top: 2px;
}

.whatflow-header-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
  line-height: 1;
  padding: 0;
}

/* ---- MULTI-AGENT MODAL STYLES ---- */
#whatflow-agent-modal {
  position: fixed;
  width: 320px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 1001;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#whatflow-agent-list { 
  list-style: none; 
  margin: 0; 
  padding: 10px; 
  max-height: 300px; 
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}

.whatflow-agent-item {
  display: flex;
  align-items: center;
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  margin-bottom: 8px;
}

.whatflow-agent-item:hover {
  background-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.whatflow-agent-item:active {
  transform: translateY(0);
}

.whatflow-agent-pfp {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  background-color: #e5e7eb;
  transition: transform 0.3s ease;
  border: 2px solid transparent;
}

.whatflow-agent-item:hover .whatflow-agent-pfp {
  transform: scale(1.05);
}

.whatflow-agent-info { 
  flex-grow: 1; 
}

.whatflow-agent-name {
  font-weight: 600;
  font-size: 15px;
  transition: color 0.3s ease;
}

.whatflow-agent-position { 
  font-size: 13px; 
  color: #6b7280; 
}

.whatflow-agent-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #10b981;
  transition: transform 0.3s ease;
}

.whatflow-agent-item:hover .whatflow-agent-status {
  transform: scale(1.05);
}

.whatflow-agent-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background-color: #10b981;
  transition: all 0.3s ease;
}

.whatflow-agent-item:hover .whatflow-agent-status-dot {
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  transform: scale(1.2);
}

/* Offline state */
.whatflow-agent-item.offline {
  cursor: not-allowed;
}

.whatflow-agent-item.offline:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.whatflow-agent-item.offline .whatflow-agent-status {
  color: #9ca3af;
}

.whatflow-agent-item.offline .whatflow-agent-name {
  color: #6b7280;
}

.whatflow-agent-item.offline .whatflow-agent-position {
  color: #9ca3af;
}

.whatflow-agent-item.offline:hover .whatflow-agent-pfp {
  transform: none;
  border-color: transparent;
}

.whatflow-agent-item.offline:hover .whatflow-agent-name {
  color: #6b7280;
}

.whatflow-agent-item.offline:hover .whatflow-agent-status {
  transform: none;
  color: #9ca3af;
}

/* ---- SINGLE AGENT POPUP STYLES ---- */
#whatflow-single-popup {
  position: fixed;
  width: 300px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.15);
  z-index: 1001;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#whatflow-single-popup-body {
  padding: 20px 16px;
}

#whatflow-single-popup-text {
  margin: 0 0 20px 0;
  color: #374151;
  line-height: 1.5;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  width: 85%;
  max-width: 85%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: auto;
}

#whatflow-single-popup-chat-btn {
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

#whatflow-single-popup-chat-btn:hover {
  filter: brightness(0.9);
}

#whatflow-single-popup-whatsapp-icon {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* ---- SHARED FOOTER STYLES ---- */
.whatflow-powered-footer {
  position: relative;
  padding: 4px;
  text-align: center;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.whatflow-powered-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(20, 184, 165, 0.08), rgba(34, 197, 94, 0.08), rgba(248, 250, 252, 1));
}

.whatflow-powered-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.whatflow-powered-footer a img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.whatflow-powered-footer a:hover {
  opacity: 0.8;
}

.whatflow-gradient-text {
  background: linear-gradient(to right, #14b8a6, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 700;
  font-size: 10px;
}

/* ---- LIVE CHAT STYLES ---- */
#whatflow-live-chat {
  position: fixed;
  width: 340px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
  z-index: 1002;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  display: none;
}

#whatflow-live-chat-body {
  padding: 20px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

#whatflow-live-chat-preset-message {
  background: white;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  width: 85%;
  max-width: 85%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: auto;
}

#whatflow-live-chat-input-section {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

#whatflow-live-chat-input-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: block;
  width: 100%;
}

#whatflow-live-chat-input-wrapper {
  flex: 1;
  position: relative;
}

#whatflow-live-chat-textarea {
  width: 100%;
  height: 44px;
  max-height: 120px;
  padding: 8px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  line-height: 1.5;
  overflow-y: auto;
}

#whatflow-live-chat-textarea:focus {
  outline: none;
}

#whatflow-live-chat-char-count {
  font-size: 11px;
  color: #9ca3af;
  position: absolute;
  bottom: -18px;
  right: 8px;
}

#whatflow-live-chat-char-count.limit-reached {
  color: #ef4444;
}

#whatflow-live-chat-send-btn {
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

#whatflow-live-chat-send-btn:hover:not(:disabled) {
  background: #059669;
}

#whatflow-live-chat-send-btn:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

#whatflow-live-chat-send-icon {
  width: 24px;
  height: 24px;
}
