/* ======================= CHAT STYLES ======================= */

/* ============= CHAT LOADING BLUR OVERLAY ============= */
#chat-loader-overlay {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    z-index: 25;
    top: 0;
    left: 0;
  }
  
  [data-bs-theme="dark"] #chat-loader-overlay {
    background-color: rgba(33, 37, 41, 0.6);
  }
  
  /* ============= CHAT HEADER ============= */
  #chat-header {
    border-bottom: 1px solid;
    padding: 2.5rem !important;
    display: flex;
    max-height: 6rem !important;
    align-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.8);
    border-bottom-color: #e4e6ef;
  }
  
  [data-bs-theme="dark"] #chat-header {
    background-color: rgba(30, 35, 45, 0.8);
    border-bottom-color: #2b2b40;
  }
  
  .header-compact {
    padding: 2.5rem !important; 
  }
  
  .user-info-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  
  .user-title-container {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  #chat-state-icon {
    font-size: 0.5rem;
  }
  
  #chat-state {
    font-size: 0.8rem !important;
  }
  
  /* ============= SCROLL BOX ============= */
  .messenger-scroll-box {
    overflow-y: auto;
    padding: 20px; 
    background-color: transparent;
    padding-top: 4rem;
    position: relative;
  }
  
  .messenger-scroll-box::-webkit-scrollbar-track {
    margin-top: 13rem !important;
  }
  
  #moreMsgLoader {
    position: sticky;
    top: 6rem;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    background: transparent;
    z-index: 15;
    border-radius: 6px;
  }
  
  #chat_messages {
    position: relative;
    z-index: 5;
  }
  
  .message-loading-area {
    opacity: 0; 
    position: absolute;
    width: 100%;
    overflow: hidden;
    height: 0;
  }
  
  .message-loading-area.loaded {
    opacity: 1;
    position: relative;
    height: auto;
    transition: opacity 0.2s ease-in;
  }
  
  /* ============= ANIMATIONS ============= */
  @keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
    100% { transform: translateY(0px) rotate(0deg); }
  }
  
  @keyframes pillExpand {
    0% {
      max-width: 40px;
      min-width: 40px;
      width: 40px;
      opacity: 0.7;
      transform: translateY(5px);
    }
    30% {
      opacity: 1;
      transform: translateY(0);
      max-width: 70%;
      width: auto;
    }
    100% {
      max-width: 70%;
      min-width: auto;
      width: auto;
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes slideInLeft {
    from {
      transform: translateX(-20px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  @keyframes slideInRight {
    from {
      transform: translateX(20px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  @keyframes replyFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  @keyframes replyFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
  }
  
  @keyframes dropUp {
    from {
      transform: translateX(-50%) translateY(100px);
      opacity: 0;
    }
    to {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
    }
  }
  
  @keyframes smoothTypingAnimation {
    0% {
      transform: translateY(0px);
    }
    25% {
      transform: translateY(-7px);
      opacity: 1;
    }
    50% {
      transform: translateY(0px);
    }
    100% {
      transform: translateY(0px);
      opacity: 0.8;
    }
  }
  
  /* ============= TYPING INDICATOR ============= */
  /* ============= TYPING INDICATOR - CREATIVE MINIMAL ALTERNATIVE ============= */
  .typing-indicator {
    padding-bottom: 8px;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateY(5px);
    position: relative;
  }
  
  .typing-indicator.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  .typing-indicator span {
    font-size: 0.85rem;
    color: var(--bs-primary);
    margin-right: 6px;
    position: relative;
  }
  
  /* Add a subtle highlight to the name */
  .typing-indicator span {
    background: linear-gradient(90deg, 
      rgba(var(--bs-primary-rgb), 0.05) 0%, 
      rgba(var(--bs-primary-rgb), 0.12) 50%, 
      rgba(var(--bs-primary-rgb), 0.05) 100%);
    padding: 3px 7px;
    border-radius: 12px;
  }
  
  /* Subtle animated underline */
  .typing-indicator span::after {
    content: '';
    position: absolute;
    left: 7px;
    bottom: 0;
    width: 0;
    height: 1px;
    background-color: var(--bs-primary);
    opacity: 0.4;
    animation: underline-grow 2s infinite;
  }
  
  @keyframes underline-grow {
    0%, 100% { width: 0; }
    50% { width: calc(100% - 14px); }
  }
  
  /* Restyle the container */
  .ticontainer {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(var(--bs-primary-rgb), 0.08);
    border-radius: 10px;
    padding: 0 3px;
    margin-left: 2px;
  }
  
  /* Add a subtle focus ring */
  .ticontainer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 12px;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    opacity: 0;
    animation: focus-pulse 2s infinite;
  }
  
  @keyframes focus-pulse {
    0%, 100% { 
      opacity: 0;
      transform: scale(0.95);
    }
    50% { 
      opacity: 1;
      transform: scale(1.02);
    }
  }
  
  .tiblock {
    display: flex;
    align-items: center;
    padding: 4px 2px;
  }
  
  /* Enhance the dots */
  .tidot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    margin: 0 2px;
    background-color: var(--bs-primary);
    position: relative;
    z-index: 1;
    transform-origin: center bottom;
    animation: dot-bounce 1.5s infinite cubic-bezier(0.45, 0, 0.55, 1);
  }
  
  .tidot::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 4px;
    background: radial-gradient(ellipse at center, 
      rgba(var(--bs-primary-rgb), 0.3) 0%, 
      rgba(var(--bs-primary-rgb), 0) 70%);
    border-radius: 50%;
    opacity: 0;
    animation: shadow-pulse 1.5s infinite cubic-bezier(0.45, 0, 0.55, 1);
  }
  
  .tidot:nth-child(1) {
    animation-delay: 0s;
  }
  .tidot:nth-child(1)::after {
    animation-delay: 0s;
  }
  
  .tidot:nth-child(2) {
    animation-delay: 0.2s;
  }
  .tidot:nth-child(2)::after {
    animation-delay: 0.2s;
  }
  
  .tidot:nth-child(3) {
    animation-delay: 0.4s;
  }
  .tidot:nth-child(3)::after {
    animation-delay: 0.4s;
  }
  
  @keyframes dot-bounce {
    0%, 100% { 
      transform: translateY(0) scale(1);
      background-color: rgba(var(--bs-primary-rgb), 0.7);
    }
    50% { 
      transform: translateY(-4px) scale(1.2);
      background-color: rgba(var(--bs-primary-rgb), 1);
    }
  }
  
  @keyframes shadow-pulse {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.5; transform: scale(1); }
  }
  
  /* ============= CHAT ITEMS IN SIDEBAR ============= */
  .chat-item {
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 6px;
    padding: 20px;
  }
  
  .chat-item:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
  }
  
  [data-bs-theme="dark"] .chat-item:hover {
    background-color: #3b3b3b;
  }
  
  .chat-item.active {
    background-color: #a0a0a02a !important;
  }
  
  [data-bs-theme="dark"] .chat-item.active {
    background-color: #7777772a !important;
  }
  
  /* Highlight for chat items with unread messages */
  .chat-item.chat-item-unread {
    position: relative;
    background-color: rgba(var(--bs-primary-rgb), 0.08) !important;
    border-left: 3px solid var(--bs-primary) !important;
    padding-left: 17px !important; /* Account for the 3px border */
    transition: all 0.3s ease;
  }
  
  /* Hover effect for unread chat items */
  .chat-item.chat-item-unread:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.12) !important;
  }
  
  /* Dark mode support */
  [data-bs-theme="dark"] .chat-item.chat-item-unread {
    background-color: rgba(var(--bs-primary-rgb), 0.15) !important;
  }
  
  [data-bs-theme="dark"] .chat-item.chat-item-unread:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.2) !important;
  }
  
  /* Badge styling */
  .badge-light-primary {
    color: var(--bs-primary) !important;
    background-color: var(--bs-primary-light, rgba(var(--bs-primary-rgb), 0.2)) !important;
  }
  
  /* Simple pulse animation for badges */
  .badge-pulse {
    animation: simple-pulse 2s infinite;
  }
  
  @keyframes simple-pulse {
    0% {
      transform: scale(0.95);
      opacity: 0.8;
    }
    50% {
      transform: scale(1.05);
      opacity: 1;
    }
    100% {
      transform: scale(0.95);
      opacity: 0.8;
    }
  }
  
  /* ============= MESSAGE ANIMATION ============= */
  .message-item.outgoing-animation .message-bubble {
    animation: pillExpand 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transform-origin: right center;
    text-overflow: ellipsis;
  }
  
  .message-item.incoming-animation .message-bubble {
    animation: pillExpand 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transform-origin: left center;
    text-overflow: ellipsis;
  }
  
  .message-bubble-content {
    overflow: hidden;
    white-space: normal;
    text-overflow: ellipsis;
    padding: 0;
    transition: all 0.6s ease;
  }
  
  .message-wrapper {
    max-width: 70%;
    width: fit-content;
    padding: 0 !important;
  }
  
  .message-bubble {
    position: relative;
    width: fit-content;
    border-radius: 18px !important;
    margin-bottom: 0 !important;
  }
  
  .message-bubble:before,
  .message-bubble:after {
    transition: opacity 0.1s ease;
    opacity: 1;
  }
  
  .message-item.animation-complete .message-bubble-content {
    white-space: normal;
    overflow: visible;
  }
  
  /* ============= APPLE-STYLE MESSAGE STYLING ============= */
  
  .time-break-container {
    margin: 16px 0;
    text-align: center;
  }
  
  .time-break-text {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    background-color: #e9e9eb;
    color: #8e8e93;
  }
  
  [data-bs-theme="dark"] .time-break-text {
    background-color: #3a3a3c;
    color: #8e8e93;
  }
  
  /* Message spacing in sequences */
  .message-item.no-tail {
    margin-bottom: 2px;
  }
  
  .message-item:not(.no-tail) {
    margin-bottom: 16px !important;
  }
  
  /* Status line styling */
  .message-metadata {
    opacity: 0.8;
  }
  
  .read-status, .message-timestamp {
    color: #8e8e93 !important;
    font-size: 0.7rem !important;
  }
  
  /* Hide "Read" when hovering to reduce clutter */
  .message-wrapper:hover .read-status {
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  
  /* Timestamp controls - hide by default */
  .message-timestamp {
    display: none;
    font-size: 0.75rem !important;
    color: #8e8e93 !important;
    margin-top: 2px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
  }
  
  /* Only show timestamps for messages that are not marked as no-tail */
  .message-item:not(.no-tail) .message-timestamp {
    display: block;
  }
  
  .message-item:hover .message-timestamp {
    opacity: 1;
  }
  
  .justify-content-start .message-wrapper .message-timestamp {
    margin-left: 0 !important;
    text-align: left !important;
    padding-left: 0 !important;
    width: 100% !important;
  }
  
  .justify-content-end .message-wrapper .message-timestamp {
    margin-right: 0 !important;
    text-align: right !important;
    padding-right: 0 !important;
    width: 100% !important;
  }
  
  /* Chat date headers */
  .chat-timestamp {
    font-size: 12px;
    color: #65676b;
    text-align: center;
    margin: 10px 0;
  }
  
  [data-bs-theme="dark"] .chat-timestamp {
    color: #92929F;
  }
  
  /* ============= MESSAGE BUBBLES STYLING ============= */
  [data-kt-element="message-text"] {
    position: relative;
    border-radius: 25px;
    padding: 8px 12px !important;
    max-width: 100% !important;
    width: auto !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin: 2px 0;
    word-wrap: break-word;
    line-height: 20px;
    padding-left: 16px !important;
  }
  
  /* Left side (other user) message bubbles */
  .justify-content-start [data-kt-element="message-text"] {
    background-color: #ececec !important;
    color: black !important;
    left: -6px;
  }
  
  /* Right side (your) message bubbles */
  .justify-content-end [data-kt-element="message-text"] {
    background-color: #0B93F6 !important;
    color: white !important;
    right: -6px;
  }
  
  /* Left side tail styling */
  .justify-content-start [data-kt-element="message-text"]:before {
    content: "";
    position: absolute;
    z-index: 2;
    bottom: -2px;
    left: -7px;
    height: 21px;
    border-left: 20px solid #ececec;
    border-bottom-right-radius: 16px 14px;
    transform: translate(0, -2px);
  }
  
  .justify-content-start [data-kt-element="message-text"]:after {
    content: "";
    position: absolute;
    z-index: 3;
    bottom: -2px;
    left: 4px;
    width: 26px;
    height: 21px;
    background: #FFFFFF;
    border-bottom-right-radius: 10px;
    transform: translate(-30px, -2px);
  }
  
  /* Right side tail styling */
  .justify-content-end [data-kt-element="message-text"]:before,
  .bg-light-primary[data-kt-element="message-text"]:before {
    content: "";
    position: absolute;
    z-index: 2;
    bottom: -2px;
    right: -7px;
    height: 21px;
    border-right: 20px solid #0B93F6;
    border-bottom-left-radius: 16px 14px;
    transform: translate(0, -2px);
  }
  
  .justify-content-end [data-kt-element="message-text"]:after,
  .bg-light-primary[data-kt-element="message-text"]:after {
    content: "";
    position: absolute;
    z-index: 3;
    bottom: -2px;
    right: -56px;
    width: 26px;
    height: 22px;
    background: #FFFFFF;
    border-bottom-left-radius: 10px;
    transform: translate(-30px, -2px);
  }
  
  /* Support for bg-light-primary and bg-light-info classes */
  .bg-light-primary[data-kt-element="message-text"] {
    background-color: #0B93F6 !important;
    color: white !important;
  }
  
  .bg-light-info[data-kt-element="message-text"] {
    background-color: #ececec !important;
    color: black !important;
  }
  
  /* Hide tails for consecutive messages from same user */
  .message-item.no-tail [data-kt-element="message-text"]:before,
  .message-item.no-tail [data-kt-element="message-text"]:after {
    display: none;
  }
  
  .message-item.no-tail {
    margin-bottom: 2px;
  }
  
  /* ============= DARK MODE STYLES ============= */
  [data-bs-theme="dark"] .justify-content-end [data-kt-element="message-text"],
  [data-bs-theme="dark"] .bg-light-primary[data-kt-element="message-text"] {
    background-color: #0B93F6 !important;
    color: #FFFFFF !important;
  }
  
  [data-bs-theme="dark"] .justify-content-end [data-kt-element="message-text"]:before,
  [data-bs-theme="dark"] .bg-light-primary[data-kt-element="message-text"]:before {
    border-right-color: #0B93F6;
  }
  
  [data-bs-theme="dark"] .justify-content-end [data-kt-element="message-text"]:after,
  [data-bs-theme="dark"] .bg-light-primary[data-kt-element="message-text"]:after {
    background-color: #15171C;
  }
  
  [data-bs-theme="dark"] .justify-content-start [data-kt-element="message-text"],
  [data-bs-theme="dark"] .bg-light-info[data-kt-element="message-text"] {
    background-color: #2B2B40 !important;
    color: #FFFFFF !important;
  }
  
  [data-bs-theme="dark"] .justify-content-start [data-kt-element="message-text"]:before,
  [data-bs-theme="dark"] .bg-light-info[data-kt-element="message-text"]:before {
    border-left-color: #2B2B40;
  }
  
  [data-bs-theme="dark"] .justify-content-start [data-kt-element="message-text"]:after,
  [data-bs-theme="dark"] .bg-light-info[data-kt-element="message-text"]:after {
    background-color: #15171C;
  }
  
  /* ============= AVATAR STYLING ============= */
  .symbol-35px {
    width: 35px !important;
    height: 35px !important;
    z-index: 5;
  }
  
  .symbol-50px {
    width: 50px !important;
    height: 50px !important;
    z-index: 5;
  }
  
  /* ============= MESSAGE INPUT ============= */
  #message_input {
    border-radius: 24px !important;
    padding: 10px 15px !important;
    background-color: #f0f2f5;
  }
  
  [data-bs-theme="dark"] #message_input {
    background: #1B1C21;
    border-radius: 24px !important;
  }
  
  /* ============= CARD STYLING ============= */
  .card {
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }
  
  .card-footer {
    border-top: 1px solid #e4e6ef;
    padding: 12px 20px;
    background-color: transparent;
  }
  
  [data-bs-theme="dark"] .card-footer {
    border-top: 1px solid #2B2B40;
  }
  
  /* ============= SCROLL TO BOTTOM BUTTON ============= */
  #scrollToBottom {
    position: sticky;
    left: 50%;
    z-index: 1000;
    bottom: 20px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: -45px;
  }
  
  #scrollToBottom.hidden {
    opacity: 0;
    visibility: hidden;
  }
  
  #scrollToBottom.appearing {
    animation: dropUp 0.4s forwards ease-out;
  }
  
  #scrollToBottom i {
    font-size: 1.25rem;
  }
  
  /* ============= EDITED MESSAGES STYLING ============= */
  .edited-indicator-container {
    font-size: 0.65rem !important;
    color: #8e8e93 !important;
    opacity: 0.7;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
  }
  
  .justify-content-end .edited-indicator-container {
    text-align: right !important;
    margin-right: 4px;
  }
  
  .justify-content-start .edited-indicator-container {
    text-align: left !important;
    margin-left: 4px;
  }
  
  .edited-indicator {
    font-weight: bold!important;
    font-size: 0.7rem;
  }
  
  [data-bs-theme="dark"] .edited-indicator-container {
    color: #92929f;
  }
  
  /* ============= EDITING MODE STYLING ============= */
  .message-bubble.editing-active,
  [data-kt-element="message-text"].editing-active {
    background-color: #f0f0f0 !important;
    color: #333 !important;
    border: 1px dashed #f7941d !important;
  }
  
  [data-bs-theme="dark"] [data-kt-element="message-text"].editing-active {
    background-color: #2c2c2c !important;
    color: #e0e0e0 !important;
  }
  
  .editable-options {
    background-color: #f8f9fa;
    border-radius: 18px;
    padding: 6px 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  [data-bs-theme="dark"] .editable-options {
    background-color: #2b2b40;
  }
  
  .editing-label {
    color: #a1a5b7;
    font-size: 12px;
    margin-right: auto;
  }
  
  [data-bs-theme="dark"] .editing-label {
    color: #92929f;
  }
  
  .edit-btn-cancel {
    color: #f1416c;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
  }
  
  .edit-btn-cancel:hover {
    background-color: rgba(241, 65, 108, 0.1);
  }
  
  .edit-btn-save {
    color: #009ef7;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
  }
  
  .edit-btn-save:hover {
    background-color: rgba(0, 158, 247, 0.1);
  }
  
  .edit-btn-save.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
  }
  
  .unseen-input {
    outline: 1px #f7941d !important;
  }
  
  /* ============= REPLY AREA STYLING ============= */
  .reply-area {
    background-color: white;
    box-shadow: 0 6px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    margin: 0 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    bottom: 0;
    animation: replyFadeIn 0.3s ease forwards;
  }
  
  .reply-area:hover {
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.15), 0 4px 8px -4px rgba(0, 0, 0, 0.1);
  }
  
  .reply-area.fading-out {
    animation: replyFadeOut 0.3s ease forwards;
  }
  
  .reply-container {
    background: rgba(245, 247, 250, 0.3);
    border-radius: 8px;
    margin: 0;
    position: relative;
  }
  
  #replyMsg {
    color: #5e6278 !important;
    font-weight: normal;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  
  .reply-area .fa-xmark {
    transition: all 0.2s ease;
    opacity: 0.7;
  }
  
  .reply-area .fa-xmark:hover {
    opacity: 1;
    transform: scale(1.1);
  }
  
  /* Reply inside message bubbles */
  .message-bubble .reply-container {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    margin-bottom: 8px !important;
    padding: 8px !important;
    position: relative;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.7rem;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: normal;
  }
  
  [data-bs-theme="dark"] .message-bubble .reply-container {
    background-color: rgba(114, 114, 114, 0.514);
  }
  
  .message-bubble .reply-container .reply-text {
    color: rgba(51, 51, 51, 0.568) !important;
  }
  
  [data-bs-theme="dark"] .message-bubble .reply-container .reply-text {
    color: rgb(194, 194, 194) !important;
  }
  
  .message-bubble .reply-container .position-absolute {
    border-radius: 4px;
    width: 3px !important;
  }
  
  .message-bubble .reply-container a.text-primary {
    font-size: 0.85rem;
    font-weight: 600;
  }
  
  /* ============= DELETED MESSAGE STYLING ============= */
  .deleted-message {
    opacity: 0.8 !important;
  }
  
  .deleted-message-icon {
    margin-right: 5px;
    font-size: 0.9em;
    vertical-align: middle;
  }
  
  .deleted-message-text {
    font-style: italic;
    font-size: 0.9em;
  }
  
  .justify-content-start .deleted-message {
    background-color: #f2f2f2 !important;
  }
  
  .justify-content-start .deleted-message-icon,
  .justify-content-start .deleted-message-text {
    color: #7d8894 !important;
  }
  
  .justify-content-end .deleted-message {
    background-color: rgba(11, 147, 246, 0.6) !important;
  }
  
  .justify-content-end .deleted-message-text {
    color: white !important;
  }
  
  .justify-content-end .deleted-message-icon i.fa-regular.fa-ban,
  .justify-content-end .deleted-message-icon i.fa-solid.fa-ban {
    color: white !important;
    opacity: 0.7 !important;
    text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5);
  }
  
  [data-bs-theme="dark"] .justify-content-start .deleted-message {
    background-color: #2a3441 !important;
  }
  
  /* ============= MISCELLANEOUS STYLES ============= */
  .tooltip {
    pointer-events: none;
  }
  
  kbd {
    display: inline-block;
    font-size: 0.65rem;
    line-height: 1;
  }
  
  .z-index-1 {
    z-index: 1;
  }
  
  .btn.btn-icon.menu-button {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .btn.btn-icon.menu-button:hover i {
    color: var(--bs-primary) !important;
  }
  
  .btn.btn-icon.menu-button:active, 
  .btn.btn-icon.menu-button:focus {
    background-color: transparent !important;
  }
  
  .chat-more-options {
    width: 150px;
  }
  
  .menu-button + .menu {
    transform: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0rem !important;
  }
  
  .info-btn {
    padding: 5px;
    border-radius: 50px;
  }
  
  .info-btn:hover {
    background-color: var(--bs-secondary);
    color: var(--bs-primary);
  }
  
  .message-item + .message-item {
    margin-top: 0.5rem;
  }
  
  .incoming-animation .message-wrapper,
  .outgoing-animation .message-wrapper {
    animation-duration: 0.65s;
    animation-fill-mode: both;
  }
  
  .incoming-animation .message-wrapper {
    animation-name: slideInLeft;
  }
  
  .outgoing-animation .message-wrapper {
    animation-name: slideInRight;
  }
  
  .tip-divider {
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    background-color: #cecece!important;
  }
  
  [data-bs-theme="dark"] .tip-divider {
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 2px;
    background-color: #333333!important;
  }
  
  .attachment-img{
    height: 300px;
    border-radius: 12px;
    padding: 2px;
    width: 100%;
  }
  
  .attach-download-btn{
    border-radius: 12px;
  }
  
  .fullscreen-attachment{
    width: 100%;
    height: 78vh;
  }
  
  img.fullscreen-attachment{
    object-fit: contain;
  }
  
  .unuploaded-attachment{
    width: 150px;
    height: 100px;
    border-radius: 5px;
    border: 2px solid var(--bs-secondary);
  }
  
  .attach-icon{
    top: 2px;
    right: 2px;
    position: absolute !important;
    cursor: pointer;
    z-index: 15;
  }
  
  /* ============= CHAT SEARCH STYLES ============= */
  
  /* Search container */
  .chat-search-container {
    transition: all 0.2s ease;
  }
  
  /* Search highlight styles */
  .search-highlight {
    background-color: #f7951d8f;
    border-radius: 2px;
    padding: 0 2px;
    margin: 0 -2px;
    position: relative;
    z-index: 1;
  }
  
  .search-highlight-active {
    background-color: #f7951d8f;
    color: #000 !important;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5);
    z-index: 2;
  }
  
  /* File match highlight */
  .file-search-match {
    outline: 2px solid #ffc107;
    border-radius: 4px;
    background-color: rgba(255, 193, 7, 0.1);
  }
  
  /* Animation classes */
  .animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
  }
  
  .animate__faster {
    animation-duration: 0.2s;
  }
  
  @keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
  }
  
  .animate__fadeInDown {
    animation-name: fadeInDown;
  }
  
  @keyframes fadeOutUp {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
  }
  
  .animate__fadeOutUp {
    animation-name: fadeOutUp;
  }
  
  /* Adjustments for search UI */
  .chat-search-container .card {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }
  
  .search-result-count {
    min-width: 70px;
    text-align: center;
  }
  
  /* Custom button states */
  .search-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  
  .search-controls .btn:not(:disabled):hover {
    background-color: #e9ecef;
  }
  
  /* Ensure search highlight works for both light and dark theme */
  .bg-light-primary .search-highlight {
    color: #333;
  }
  
  .bg-light-info .search-highlight {
    color: #333;
  }
  
  /* Ensure proper spacing in search container */
  .chat-search-container .card-header {
    padding: 0.5rem 1rem;
  }
  
  .assistance-request-mini{
    background-color: var(--bs-page-bg);
    cursor: pointer;
    width: 30%;
    border-radius: 12px;
  }
  
  .symbol-circle img{
    object-fit: cover;
  }
  
  .tag-user-area{
    background-color: var(--bs-secondary);
    bottom: 50px;
    border-radius: 20px;
    left: 80px;
  }
  
  .group-modal-body{
    height: 85vh;
    overflow-y: auto;
  }
  