/* Ticketino Live Chat Styles */

/* Chat Widget Button */
.ticketino-chat-widget {
  position: fixed;
  z-index: 9999;
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  direction: rtl;
}

.ticketino-chat-widget.bottom-right {
  bottom: 20px;
  right: 20px;
}

.ticketino-chat-widget.bottom-left {
  bottom: 20px;
  left: 20px;
}

.ticketino-chat-widget.top-right {
  top: 20px;
  right: 20px;
}

.ticketino-chat-widget.top-left {
  top: 20px;
  left: 20px;
}

.ticketino-chat-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 15px 25px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ticketino-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.ticketino-chat-button.minimized {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
}

.ticketino-chat-button.minimized .ticketino-chat-button-text {
  display: none;
}

.ticketino-chat-button i {
  font-size: 18px;
}

/* Chat Window */
.ticketino-chat-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 380px;
  height: 500px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  animation: slideUp 0.3s ease;
}

.ticketino-chat-window.active {
  display: flex;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.ticketino-chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white ;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticketino-chat-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ticketino-chat-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 5px;
}

.ticketino-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

.ticketino-status-indicator.waiting {
  background: #f59e0b;
}

.ticketino-status-indicator.offline {
  background: #ef4444;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.ticketino-chat-controls {
  display: flex;
  gap: 5px;
}

.ticketino-chat-minimize,
.ticketino-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ticketino-chat-minimize:hover,
.ticketino-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Content */
.ticketino-chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Start Form */
.ticketino-chat-start {
  padding: 30px;
  text-align: center;
}

.ticketino-chat-start h3 {
  margin: 0 0 10px 0;
  color: #1f2937;
  font-size: 18px;
}

.ticketino-chat-start p {
  color: #6b7280;
  margin: 0 0 25px 0;
  font-size: 14px;
  line-height: 1.5;
}

.ticketino-form-group {
  margin-bottom: 20px;
  text-align: right;
}

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

.ticketino-form-group input,
.ticketino-form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.ticketino-form-group input:focus,
.ticketino-form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.ticketino-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.ticketino-start-chat-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
  width: 100%;
}

.ticketino-start-chat-btn:hover {
  transform: translateY(-1px);
}

.ticketino-start-chat-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Chat Messages */
.ticketino-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ticketino-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ticketino-chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.ticketino-chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.ticketino-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Message Styles */
.ticketino-message {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ticketino-message.user {
  align-items: flex-end;
}

.ticketino-message.admin {
  align-items: flex-start;
}

.ticketino-message.system {
  align-items: center;
}

.ticketino-message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}

.ticketino-message.user .ticketino-message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 6px;
}

.ticketino-message.admin .ticketino-message-bubble {
  background: white;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ticketino-message.system .ticketino-message-bubble {
  background: #f3f4f6;
  color: #6b7280;
  font-style: italic;
  font-size: 12px;
  border-radius: 15px;
  text-align: center;
  font-family:"Vazirmatn";
}

.ticketino-message-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 11px;
  color: #9ca3af;
}

.ticketino-message.user .ticketino-message-info {
  justify-content: flex-end;
}

.ticketino-message.admin .ticketino-message-info {
  justify-content: flex-start;
}

.ticketino-message.system .ticketino-message-info {
  justify-content: center;
}

.ticketino-message-sender {
  font-weight: 500;
}

.ticketino-message-time {
  font-size: 10px;
}

/* Chat Input */
.ticketino-chat-input {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

.ticketino-chat-input-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ticketino-message-input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  min-height: 40px;
  transition: border-color 0.2s;
}

.ticketino-message-input:focus {
  outline: none;
  border-color: #667eea;
}

.ticketino-send-btn {
  background: #667eea;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ticketino-send-btn:hover {
  background: #5a67d8;
}

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

/* File Upload */
.ticketino-file-upload {
  margin-top: 10px;
}

.ticketino-file-input {
  display: none;
}

.ticketino-file-upload-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #6b7280;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.ticketino-file-upload-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.ticketino-file-preview {
  margin-top: 10px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
  display: none;
}

.ticketino-file-preview.active {
  display: block;
}

.ticketino-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
}

.ticketino-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}

.ticketino-file-remove {
  background: #ef4444;
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Audio Recording */
.ticketino-audio-controls {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.ticketino-record-btn {
  background: #ef4444;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ticketino-record-btn.recording {
  animation: recordPulse 1s infinite;
}

@keyframes recordPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.ticketino-record-time {
  font-size: 12px;
  color: #6b7280;
  font-family: monospace;
}

.ticketino-audio-preview {
  margin-top: 10px;
  display: none;
}

.ticketino-audio-preview.active {
  display: block;
}

.ticketino-audio-player {
  width: 100%;
  height: 30px;
}

/* Loading States */
.ticketino-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #6b7280;
}

.ticketino-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error States */
.ticketino-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  margin: 10px 0;
  border: 1px solid #fecaca;
}

/* Success States */
.ticketino-success {
  background: #f0fdf4;
  color: #16a34a;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  margin: 10px 0;
  border: 1px solid #bbf7d0;
}

/* Typing Indicator */
.ticketino-typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  color: #6b7280;
  font-size: 12px;
  font-style: italic;
}

.ticketino-typing-dots {
  display: flex;
  gap: 3px;
}

.ticketino-typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typingDot 1.4s infinite ease-in-out;
}

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

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

@keyframes typingDot {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Notification Badge */
.ticketino-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* Dark Mode */
.ticketino-chat-widget.dark-mode .ticketino-chat-window {
  background: #1f2937;
  color: white;
}

.ticketino-chat-widget.dark-mode .ticketino-chat-messages {
  background: #111827;
}

.ticketino-chat-widget.dark-mode .ticketino-message.admin .ticketino-message-bubble {
  background: #374151;
  color: white;
  border-color: #4b5563;
}

.ticketino-chat-widget.dark-mode .ticketino-chat-input {
  background: #1f2937;
  border-color: #374151;
}

.ticketino-chat-widget.dark-mode .ticketino-message-input {
  background: #374151;
  color: white;
  border-color: #4b5563;
}

/* Responsive Design */
@media (max-width: 480px) {
  .ticketino-chat-window {
    /* keep the window no wider than its default, but allow shrinking on very small screens */
    width: min(380px, calc(100vw - 40px));
    height: calc(100vh - 140px);
    right: 20px;
    left: auto;
    bottom: 100px;
  }

  /* For bottom-left position, anchor to left; for bottom-right anchor to right.
     Do not set both left and right simultaneously which forces full-width. */
  .ticketino-chat-widget.bottom-left .ticketino-chat-window {
    left: 20px;
    right: auto;
  }

  .ticketino-chat-widget.bottom-right .ticketino-chat-window {
    right: 20px;
    left: auto;
  }

  .ticketino-message-bubble {
    max-width: 90%;
  }

  .ticketino-chat-start {
    padding: 20px;
  }
}

/* Admin Chat Styles */
.ticketino-admin-chat-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.ticketino-admin-chat-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.ticketino-admin-chat-tab {
  flex: 1;
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ticketino-admin-chat-tab:hover {
  background: #e9ecef;
  color: #2563eb;
}

.ticketino-admin-chat-tab.active {
  background: #2563eb;
  color: white;
}

.ticketino-chat-list {
  min-height: 400px;
  padding: 20px;
}

.ticketino-chat-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.ticketino-chat-item:hover {
  background: #f3f4f6;
  border-color: #2563eb;
}

.ticketino-chat-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.ticketino-chat-item-name {
  font-weight: 600;
  color: #1f2937;
}

.ticketino-chat-item-time {
  font-size: 12px;
  color: #6b7280;
}

.ticketino-chat-item-preview {
  color: #6b7280;
  font-size: 14px;
}

.ticketino-chat-item-actions {
  display: flex;
  gap: 10px;
}

.ticketino-join-chat-btn,
.ticketino-view-chat-btn,
.ticketino-end-chat-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.ticketino-join-chat-btn {
  background: #10b981;
  color: white;
}

.ticketino-join-chat-btn:hover {
  background: #059669;
}

.ticketino-view-chat-btn {
  background: #2563eb;
  color: white;
}

.ticketino-view-chat-btn:hover {
  background: #1d4ed8;
}

.ticketino-end-chat-btn {
  background: #ef4444;
  color: white;
}

.ticketino-end-chat-btn:hover {
  background: #dc2626;
}

.ticketino-no-chats {
  text-align: center;
  padding: 50px;
  color: #6b7280;
}

.ticketino-no-chats i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Chat History Styles */
.ticketino-chat-history {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.ticketino-chat-history-header {
  background: #f8f9fa;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticketino-chat-history-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.ticketino-chat-history-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ticketino-chat-history-filter {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  background: white;
}

.ticketino-chat-history-list {
  max-height: 500px;
  overflow-y: auto;
}

.ticketino-chat-history-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.2s;
}

.ticketino-chat-history-item:hover {
  background: #f9fafb;
}

.ticketino-chat-history-item:last-child {
  border-bottom: none;
}

.ticketino-chat-history-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.ticketino-chat-history-visitor {
  font-weight: 600;
  color: #1f2937;
}

.ticketino-chat-history-date {
  font-size: 12px;
  color: #6b7280;
}

.ticketino-chat-history-duration {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.ticketino-chat-history-preview {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticketino-chat-history-stats {
  display: flex;
  gap: 15px;
  margin-top: 8px;
}

.ticketino-chat-history-stat {
  font-size: 11px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Chat Detail Modal */
.ticketino-chat-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.ticketino-chat-detail-modal.active {
  display: flex;
}

.ticketino-chat-detail-content {
  background: white;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  height: 80%;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ticketino-chat-detail-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticketino-chat-detail-title {
  margin: 0;
  font-size: 18px;
}

.ticketino-chat-detail-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s;
}

.ticketino-chat-detail-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ticketino-chat-detail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ticketino-chat-detail-info {
  background: #f8f9fa;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticketino-chat-detail-visitor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticketino-chat-detail-visitor-name {
  font-weight: 600;
  color: #1f2937;
}

.ticketino-chat-detail-visitor-email {
  font-size: 12px;
  color: #6b7280;
}

.ticketino-chat-detail-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: #6b7280;
}

.ticketino-chat-detail-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafb;
}

/* Responsive for Chat History */
@media (max-width: 768px) {
  .ticketino-chat-history-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .ticketino-chat-history-filter {
    width: 100%;
  }

  .ticketino-chat-history-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .ticketino-chat-history-stats {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ticketino-chat-detail-content {
    width: 95%;
    height: 90%;
  }

  .ticketino-chat-detail-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ticketino-chat-detail-meta {
    align-items: flex-start;
  }
}

/* Live Chat Admin Styles */
.live-chat-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.live-chat-header {
  text-align: center;
  margin-bottom: 30px;
}

.live-chat-header h1 {
  font-size: 2.5em;
  color: #2563eb;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.live-chat-header p {
  color: #6b7280;
  font-size: 1.1em;
}

/* Chat Statistics */
.chat-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.active {
  border-left: 4px solid #10b981;
}

.stat-card.waiting {
  border-left: 4px solid #f59e0b;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.stat-content h3 {
  font-size: 2em;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.stat-content p {
  color: #6b7280;
  margin: 5px 0 0 0;
  font-size: 0.9em;
}

/* Chat Management Tabs */
.chat-management-tabs {
  background: white;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.tab-navigation {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.tab-btn {
  flex: 1;
  padding: 15px 20px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: #e9ecef;
  color: #2563eb;
}

.tab-btn.active {
  background: #2563eb;
  color: white;
}

.tab-content {
  display: none;
  padding: 30px;
}

.tab-content.active {
  display: block;
}

/* Chat List */
.chat-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.chat-list-header h3 {
  margin: 0;
  color: #1f2937;
}

.chat-history-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.refresh-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: #e5e7eb;
}

.chat-list {
  min-height: 300px;
}

.chat-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.chat-item:hover {
  background: #f3f4f6;
  border-color: #2563eb;
}

.chat-item-info h4 {
  margin: 0 0 5px 0;
  color: #1f2937;
  font-size: 16px;
  font-family:"Vazirmatn";
}

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

.chat-item-meta {
  text-align: left;
  color: #9ca3af;
  font-size: 12px;
}

.chat-item-actions {
  display: flex;
  gap: 10px;
}

.join-chat-btn,
.view-chat-btn,
.end-chat-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.join-chat-btn {
  background: #10b981;
  color: white;
}

.join-chat-btn:hover {
  background: #059669;
}

.view-chat-btn {
  background: #2563eb;
  color: white;
}

.view-chat-btn:hover {
  background: #1d4ed8;
}

.end-chat-btn {
  background: #ef4444;
  color: white;
}

.end-chat-btn:hover {
  background: #dc2626;
}

/* Chat Modal */
.chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-modal-content {
  background: white;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  height: 80%;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-modal {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chat-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f9fafb;
}

.chat-input-container {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-wrapper textarea {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 20px;
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-input-wrapper textarea:focus {
  outline: none;
  border-color: #2563eb;
}

/* رفع مشکل وسط نبودن آیکون دکمه ارسال */
.send-message-btn {
  background: #2563eb;
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  padding: 0;
  transition: background 0.2s;
}


.send-message-btn:hover {
  background: #1d4ed8;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 50px;
  color: #6b7280;
  font-size: 16px;
}

.loading-spinner i {
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px;
  color: #6b7280;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
  .chat-stats-grid {
    grid-template-columns: 1fr;
  }

  .tab-navigation {
    flex-direction: column;
  }

  .chat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .chat-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .chat-history-filters {
    flex-direction: column;
    width: 100%;
  }

  .chat-history-filters > * {
    width: 100%;
  }
}
