/**
 * Chat Widget Extra Styles
 * Additional styles shared by user and guest chat widgets
 */

/* Chat Widget Badge Styles */
.chat-unread-badge {
  display: inline-block;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 8px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Loading State */
.chat-widget-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: white;
  gap: 16px;
}

.chat-widget-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.chat-widget-loading p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Guest Login Form - Matching chat modal style */
.guest-login-form {
  padding: 0;
  background: white;
  display: flex;
  flex-direction: column;
}

.guest-login-form .chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
}

.guest-login-form .chat-header .chat-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.guest-login-form .chat-header .chat-icon-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.guest-login-form .chat-header .chat-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.guest-login-form > p {
  margin: 0;
  padding: 20px 20px 0 20px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.guest-login-form form {
  padding: 20px;
}

.guest-login-form h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.guest-login-form p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.guest-form-group {
  margin-bottom: 16px;
}

.guest-form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.guest-form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.2s;
  box-sizing: border-box;
  color: #111827;
}

.guest-form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.guest-form-group input::placeholder {
  color: #9ca3af;
}

.guest-login-btn {
  width: 100%;
  padding: 10px 24px;
  background: linear-gradient(135deg, #2563EB 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 8px;
}

.guest-login-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.guest-login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.guest-error {
  margin-top: 16px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.5;
}

.guest-success {
  margin-top: 16px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #16a34a;
  font-size: 14px;
  line-height: 1.5;
}

/* Guest view does not use back navigation */
#guest-chat-widget .chat-back-btn {
  display: none;
}

/* Guest Chat Messages - Match User Chat Style */
.chat-message-sender {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .guest-login-form {
    padding: 20px;
  }
}
