/* Custom styles for Chat Management System */

  /* Chat card hover effect */
  .chat-card {
    transition: all 0.2s ease;
  }

  .chat-card:hover {
    /* transform: translateY(-3px); */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
  }

  /* Chat preview text truncation */
  .chat-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
  }

/* Updated chat-messages class for proper scrolling */
.chat-messages {
    height: 500px;
    max-height: 500px; /* Ensure maximum height is enforced */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 15px; /* Add some padding */
    scrollbar-width: thin; /* For Firefox */
    scroll-behavior: smooth; /* For smooth scrolling when appending */
  }

  /* Make sure messages inside are contained properly */
  .message {
    width: 100%;
    margin-bottom: 10px;
    display: flex;
    flex-shrink: 0; /* Prevent messages from shrinking */
  }

  /* Make sure the container of chat-messages has proper height */
  .chat-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Set appropriate height */
  }

  /* Ensure the parent elements allow proper scrolling */
  .your-chat-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Additional fix to ensure date dividers don't break layout */
  .date-divider {
    width: 100%;
    text-align: center;
    margin: 10px 0;
    position: relative;
    flex-shrink: 0; /* Prevent dividers from shrinking */
  }

  /* Scrollbar styling */
  .chat-messages::-webkit-scrollbar {
    width: 6px;
  }

  .chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
  }

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

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

  /* Message styling */
  .chat-message {
    max-width: 85%;
  }

  .customer-message {
    align-self: flex-start;
  }

  .ai-message, .staff-message {
    align-self: flex-end;
  }

  /* Status indicators */
  .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
  }

  .status-online {
    background-color: #198754;
  }

  .status-busy {
    background-color: #ffc107;
  }

  .status-offline {
    background-color: #6c757d;
  }

  /* Custom card shadows */
  .shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
  }

  /* Responsive adjustments */
  @media (max-width: 767.98px) {
    .chat-preview {
      max-width: 150px;
    }
  }

  .refresh_button {
    color: white;
    background-color: #222;
    font-weight: 500;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 0.4rem 1rem;
    cursor: pointer;
    text-align: center;
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    border: none;
    margin-left: 1rem;
}

.refresh_button:hover {
    background-color: #333;
}

.refresh_button svg {
    display: inline;
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.5rem;
    color: white;
}

.refresh_button:focus svg {
    animation: spin_357 0.5s linear;
}

@keyframes spin_357 {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.user_margin{
    margin-left: 20px;
}

.badge {
    color: white !important;
  }

.stat-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.badge-soft-success {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--success-color);
}

.badge-soft-warning {
    background-color: rgba(246, 194, 62, 0.1);
    color: var(--warning-color);
}

.badge-soft-primary {
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
}

.badge-soft-secondary {
    background-color: rgba(133, 135, 150, 0.1);
    color: var(--secondary-color);
}

.online-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    left: 0px;
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-xs {
    width: 32px;
    height: 32px;
}

.chat-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.search > .search-input {
    width: 200px;
    height: 38px;
}

.search_filter {
    padding-left: 2.5rem;
    background-color: #f8f9fc;
    border: 1px solid #eaecf4;
}

.btn-action {
    transition: all 0.2s;
}

.btn-action:hover {
    background-color: #f8f9fc;
}

.unread-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Custom scrollbar */
.chat-list {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.chat-list::-webkit-scrollbar {
    width: 5px;
}

.chat-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.message .message-attachment {
    color: #49c1df;
    cursor: pointer;
}

.message.outgoing .message-attachment {
    color: inherit;
    cursor: pointer;
}

.avatar-right img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
}


.button-with-icon {
    overflow: hidden;
    justify-content: center;
    letter-spacing: 1px;
    min-width: 120px;
    height: 35px;
    text-transform: uppercase;
    outline: none;
    user-select: none;
    transform: translateY(0px);
    position: relative;
    box-shadow: inset 0 30px 30px -15px rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 1px 20px rgba(0, 0, 0, 0), 0 3px 0 #0f988e, 0 3px 2px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.1);
    background: #222;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    transition: 150ms all ease-in-out;
    color: white;
    background-color: #222;
    font-weight: 500;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.7;
    padding: 0.4rem 1rem;
    text-align: center;
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    border: none;
}

.button-with-icon .icon {
  margin-right: 8px;
  width: 24px;
  height: 24px;
  transition: all 0.5s ease-in-out;
}

.button-with-icon:active {
  transform: translateY(10px);
  box-shadow:
    inset 0 16px 2px -15px rgba(0, 0, 0, 0),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    inset 0 1px 20px rgba(0, 0, 0, 0.1),
    0 0 0 #0f988e,
    0 0 0 2px rgba(255, 255, 255, 0.5),
    0 0 0 rgba(0, 0, 0, 0),
    0 0 0 rgba(0, 0, 0, 0);
}

.button-with-icon:hover .text {
  transform: translateX(120px);
}
.button-with-icon:hover .icon {
  transform: translate(40px);
}

.text {
  transition: all 0.5s ease-in-out;
}

