/* Support Page Specific Styles */

/* Custom Loader Animation */
.loader {
  position: relative;
  width: 75px;
  height: 100px;
  background-repeat: no-repeat;
  background-image: linear-gradient(#DDD 50px, transparent 0),
                    linear-gradient(#DDD 50px, transparent 0),
                    linear-gradient(#DDD 50px, transparent 0),
                    linear-gradient(#DDD 50px, transparent 0),
                    linear-gradient(#DDD 50px, transparent 0);
  background-size: 8px 100%;
  background-position: 0px 90px, 15px 78px, 30px 66px, 45px 58px, 60px 50px;
  animation: pillerPushUp 4s linear infinite;
  margin: 0 auto;
}

.loader:after {
  content: '';
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 10px;
  height: 10px;
  background: #de3500;
  border-radius: 50%;
  animation: ballStepUp 4s linear infinite;
}

/* Dark mode support */
[data-bs-theme="dark"] .loader {
  background-image: linear-gradient(#555 50px, transparent 0),
                    linear-gradient(#555 50px, transparent 0),
                    linear-gradient(#555 50px, transparent 0),
                    linear-gradient(#555 50px, transparent 0),
                    linear-gradient(#555 50px, transparent 0);
}

.loader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  flex-direction: column;
}

@keyframes pillerPushUp {
  0%, 40%, 100% {
    background-position: 0px 90px, 15px 78px, 30px 66px, 45px 58px, 60px 50px;
  }
  50%, 90% {
    background-position: 0px 50px, 15px 58px, 30px 66px, 45px 78px, 60px 90px;
  }
}

@keyframes ballStepUp {
  0% {transform: translate(0, 0)}
  5% {transform: translate(8px, -14px)}
  10% {transform: translate(15px, -10px)}
  17% {transform: translate(23px, -24px)}
  20% {transform: translate(30px, -20px)}
  27% {transform: translate(38px, -34px)}
  30% {transform: translate(45px, -30px)}
  37% {transform: translate(53px, -44px)}
  40% {transform: translate(60px, -40px)}
  50% {transform: translate(60px, 0)}
  57% {transform: translate(53px, -14px)}
  60% {transform: translate(45px, -10px)}
  67% {transform: translate(37px, -24px)}
  70% {transform: translate(30px, -20px)}
  77% {transform: translate(22px, -34px)}
  80% {transform: translate(15px, -30px)}
  87% {transform: translate(7px, -44px)}
  90% {transform: translate(0, -40px)}
  100% {transform: translate(0, 0);}
}

/* Loading overlay styles */
.dashboard-loading-overlay,
.analytics-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* The loader container adds padding around the loader */
.loader-container {
  padding: 30px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 200px;
}

/* Dark mode support */
[data-bs-theme="dark"] .dashboard-loading-overlay,
[data-bs-theme="dark"] .analytics-loading-overlay {
  background-color: rgba(33, 37, 41, 0.8);
}

[data-bs-theme="dark"] .loader-container {
  background: #2c3034;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Ticket list scrollable container */
.ticket-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 5px;
}

/* Scrollbar styling for webkit browsers */
.ticket-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.ticket-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ticket-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.ticket-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Message history scrollable container */
.msg_history {
    height: 350px;
    overflow-y: auto;
    padding: 15px;
    background-color: #fafafa;
    list-style: none; /* Remove bullet points */
}

/* Message container list items */
.msg_history li,
.messages li,
.message-item {
    list-style-type: none; /* Remove bullet points for all list items */
    padding-left: 0; /* Remove default padding */
}

/* Ensure the messages container also has proper styling */
.messages {
    list-style: none; /* Remove bullet points */
    padding-left: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
}

/* Scrollbar styling for message history */
.msg_history::-webkit-scrollbar {
    width: 6px;
}

.msg_history::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.msg_history::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

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

/* Chat body container */
.chat-body {
    background-color: #fafafa;
    border-bottom: 1px solid #e9ecef;
}

/* Chat item styling */
.chat-item {
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.chat-item:hover {
    background-color: rgba(15, 108, 189, 0.05);
}

.chat-item.active {
    background-color: rgba(15, 108, 189, 0.1);
}

.chat-item a {
    padding: 10px 8px;
    text-decoration: none;
    color: inherit;
    display: block;
}

.chat-item .text-body {
    font-weight: 600;
    margin-bottom: 4px;
    color: #212529;
}

.chat-item .text-secondary {
    color: #6c757d;
}

/* Profile initials in circle */
.w-36px {
    width: 36px !important;
}

.h-36px {
    height: 36px !important;
}

.w-37px {
    width: 37px !important;
}

.h-37px {
    height: 37px !important;
}

/* Message item structure */
.message-item {
    margin-bottom: 22px;
    clear: both;
}

/* Message bubble base styles */
.message .bubble {
    padding: 12px 16px;
    border-radius: 18px;
    display: inline-block;
    margin-bottom: 5px;
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}

.message .bubble p {
    margin-bottom: 0;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Avatar styling */
.message-item .avatar {
    min-width: 36px;
    height: 36px;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Message timestamps */
.message span {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    opacity: 0.8;
}

/* Client messages (on the right) */
.message-item.me {
    text-align: right;
}

.message-item.me .d-flex {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.message-item.me .content {
    margin-right: 10px;
    max-width: 75%;
}

.message-item.me .message {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message-item.me .bubble {
    background-color: #228BE6;
    color: white;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    text-align: left;
}

.message-item.me .message span {
    text-align: right;
    padding-right: 2px;
}

/* Admin messages (on the left) */
.message-item.friend {
    text-align: left;
}

.message-item.friend .content {
    margin-left: 10px;
    max-width: 75%;
}

.message-item.friend .message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.message-item.friend .bubble {
    background-color: #F1F3F5;
    color: #343a40;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    text-align: left;
}

.message-item.friend .message span {
    text-align: left;
    padding-left: 2px;
}

/* Badge colors */
.badge.bg-primary {
    background-color: #0F6CBD !important;
}

.badge.bg-warning {
    background-color: #EAA300 !important;
}

.badge.bg-success {
    background-color: #13A10E !important;
}

.badge.bg-danger {
    background-color: #D13438 !important;
}

.text-primary {
    color: #0F6CBD !important;
}

.text-warning {
    color: #EAA300 !important;
}

.text-success {
    color: #13A10E !important;
}

.text-danger {
    color: #D13438 !important;
}

/* Chat footer styling */
.chat-footer {
    padding: 12px 15px;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
}

.chat-footer .form-control {
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.chat-footer .form-control:focus {
    border-color: #228BE6;
    box-shadow: 0 0 0 0.25rem rgba(34, 139, 230, 0.25);
}

.chat-footer .btn-icon {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .ticket-scroll-container {
        max-height: 300px;
    }
    
    .msg_history {
        height: 300px;
    }
}