/* Cursor pointer for friend suggestions in New Message modal */
#recipientSuggestions .list-group-item {
  cursor: pointer;
}
/* Ensure modal text is dark for readability */
.modal-text-dark {
  color: #212529 !important; /* Bootstrap's text-dark */
}
/* Mattermost UI Styles */
:root {
    --mm-primary: #1e325c;
    --mm-secondary: #28427b;
    --mm-success: #339970;
    --mm-danger: #d24b47;
    --mm-warning: #ffbc42;
    --mm-info: #07c1e4;
    --mm-light: #f8f9fa;
    --mm-dark: #3f4350;
    --mm-navbar-bg: #14213E;
    --mm-team-sidebar-bg: #192A4D;
    --mm-channel-sidebar-bg: #1E325C;
    --mm-chat-area-bg: #f8f9fa;
    --mm-sidebar-text: #ffffff;
    --mm-border: #e6e6e6;
    --mm-hover: #f1f1f1;
    --mm-online: #06d6a0;
    --mm-away: #ffbc42;
    --mm-offline: #999999;
    /* ===== Chat Font Control ===== */
    --chat-font-size-base: 13px;   /* 👈 make smaller here */
    --chat-font-size-sm:   12px;
    --chat-font-size-xs:   11px;
    --chat-line-height:    1.4;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    background-color: var(--mm-chat-area-bg);
    font-size: 14px;
}

/* Main container styling */
.container-fluid.p-0 {
    height: calc(100vh - 56px);
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.row.g-0 {
    height: 100%;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Column styling */
.col-auto, .col-3, .col {
    padding: 0;
    margin: 0;
    min-width: 0;
    flex-shrink: 0;
    overflow: hidden;
}

.col {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Custom Navbar */
.custom-navbar {
    background-color: var(--mm-navbar-bg) !important;
}

/* Team Sidebar */
.team-sidebar {
    width: 70px;
    background-color: var(--mm-team-sidebar-bg);
    height: calc(100vh - 56px);
    border-right: 1px solid var(--mm-border);
    overflow: hidden;
}

.team-list {
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.team-item {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background-color: var(--mm-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.team-item:hover {
    background-color: var(--mm-primary);
    transform: translateY(-1px);
}

.team-item.active {
    background-color: var(--mm-primary);
    box-shadow: 0 0 0 2px var(--mm-info);
}

.team-item.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--mm-info);
    border-radius: 0 2px 2px 0;
}

.team-icon {
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.team-add {
    width: 50px;
    height: 50px;
    border: 2px dashed var(--mm-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--mm-secondary);
    transition: all 0.2s ease;
}

.team-add:hover {
    border-color: var(--mm-primary);
    color: var(--mm-primary);
}

/* Channel Sidebar */
.channel-sidebar {
    background-color: var(--mm-channel-sidebar-bg);
    height: calc(100vh - 56px);
    border-right: 1px solid var(--mm-border);
    color: var(--mm-sidebar-text);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h5 {
    color: white;
    font-weight: bolder;
}

.sidebar-content {
    flex: 1;
    padding: 10px 0;
    display: block;
}

.channel-section {
    margin-bottom: 25px;
}

.section-header {
    padding: 8px 20px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-add-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 2px 6px;
    border-radius: 3px;
}

.section-add-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.channel-list {
    padding: 0 10px;
}

.channel-item {
    padding: 4px 5px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: background-color 0.2s ease;
    position: relative;
}

.channel-item:hover {
    background-color: #425376;
}

.channel-item.active {
    background-color: #425376;
    color: white;
}

.channel-icon {
    margin-right: 10px;
    color: rgba(255, 255, 255, 0.6);
    width: 16px;
}

.channel-name {
    flex: 1;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item.active .channel-name,
.channel-item.active .channel-icon {
    color: white;
}

.channel-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.channel-status.online {
    background-color: var(--mm-online);
}

.channel-status.away {
    background-color: var(--mm-away);
}

.channel-status.offline {
    background-color: var(--mm-offline);
}

.unread-count {
    background-color: var(--mm-danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    margin-left: 8px;
}

/* Ensure all text in channel sidebar is light */
.channel-sidebar .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.channel-sidebar .small {
    color: rgba(255, 255, 255, 0.6) !important;
}

.channel-sidebar * {
    color: inherit;
}

.channel-sidebar .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.channel-sidebar .btn-outline-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

/* Dark dropdown menu for channel sidebar */
.channel-sidebar .dropdown-menu {
    background-color: #2c3e50 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.channel-sidebar .dropdown-item {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.2s ease;
}

.channel-sidebar .dropdown-item:hover,
.channel-sidebar .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.channel-sidebar .dropdown-item i {
    color: rgba(255, 255, 255, 0.7) !important;
}

.channel-sidebar .dropdown-item:hover i,
.channel-sidebar .dropdown-item:focus i {
    color: white !important;
}

/* Chat Area */
.chat-area {
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    overflow: hidden;
    transition: margin-right 0.3s ease-in-out;
}

.chat-area.info-panel-open {
    margin-right: 25%;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--mm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    z-index: 10;
}

.chat-header h4 {
    color: #2c3e50;
}

.chat-header .text-muted {
    color: #6c757d !important;
}

.chat-actions {
    display: flex;
    gap: 5px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
    background-color: #ffffff;
    min-width: 0;
}

/* Day Separator */
.day-separator {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.day-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--mm-border);
    z-index: 1;
}

.day-separator span {
    background-color: #ffffff;
    padding: 0 15px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

.message-group {
    margin-bottom: 20px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    position: relative;
}

.message:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.message:hover .message-actions {
    opacity: 1;
}

.message.own-message {
    flex-direction: row;
}

.message-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    color: #1e325c;
    font-size: 14px;
}

.message-time {
    font-size: 12px;
    color: #6c757d;
}

.message-text {
    color: #2c3e50;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-reactions {
    margin-top: 8px;
    display: flex;
    gap: 5px;
}

.reaction {
    background-color: #f1f1f1;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #2c3e50;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reaction:hover {
    background-color: #e6e6e6;
}

.reaction.user-reacted {
    background-color: rgba(22, 109, 224, 0.1);
    border: 1px solid #166DE0;
    color: #166DE0;
}

/* Message Actions */
.message-wrapper {
    position: relative;
}

.message-actions {
    position: absolute;
    top: -16px;
    right: 16px;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
}

.message-wrapper:hover .message-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.message-action-btn {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    font-size: 14px;
}

.message-action-btn:hover {
    background: #f1f1f1;
    color: #2c3e50;
}

/* Reply icon specific styling */
.message-action-btn .fa-reply {
    color: #666;
}

.message-action-btn:hover .fa-reply {
    color: #2c3e50;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    padding: 12px;
    display: none;
    width: 300px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-picker.show {
    display: block;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-item {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease;
}

.emoji-item:hover {
    background: #f1f1f1;
}

.emoji-categories {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e6e6e6;
}

.emoji-category {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

.emoji-category:hover,
.emoji-category.active {
    background: #f1f1f1;
    color: #2c3e50;
}

/* Reply Functionality */
.reply-context {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 12px;
    margin-bottom: -1px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #6c757d;
}

.reply-to-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6c757d;
    font-style: italic;
}

.reply-reference {
    background: var(--surface-color);
    border-left: 3px solid var(--primary-color);
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.9em;
    position: relative;
}

/* Reply icon styling in reply reference */
.reply-reference .fa-reply {
    color: #666;
}

.reply-reference::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, var(--primary-color), #4fa8f4);
}

.reply-original {
    color: #6c757d;
    font-style: italic;
}

/* Improved message input container */
.message-input-container {
    padding: 16px;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
    transition: all 0.2s ease;
    z-index: 0 !important;
}

.message-input-container:has(.reply-context) {
    padding-top: 0;
}

/* Enhanced input area */
/* Enhanced input area */
.input-area {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  position: relative;
}

.message-input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  transition: all 0.2s ease;
  background: var(--surface-color);
  color: var(--text-color);

  /* 👇 Force normal LTR typing/caret */
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;   /* neutralizes auto RTL flipping */
}

.message-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(22, 109, 224, 0.1);
}

/* If it's contenteditable, keep the fake placeholder */
.message-input[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  color: #6c757d;
}


.send-button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: transparent;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.send-button:active {
    background: #e8e8e8;
}

.reply-input-container {
    margin-top: 12px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 12px;
    display: none;
}

.reply-input-container.show {
    display: block;
}

.reply-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.reply-header i {
    margin-right: 4px;
}

.reply-to {
    font-weight: 500;
    color: #2c3e50;
    margin-left: 4px;
}

.reply-input-area {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.reply-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    resize: vertical;
    min-height: 36px;
    max-height: 120px;
}

.reply-input:focus {
    outline: none;
    border-color: #166DE0;
    box-shadow: 0 0 0 2px rgba(22, 109, 224, 0.1);
}

.reply-actions {
    display: flex;
    gap: 4px;
}

.reply-send-btn, .reply-cancel-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reply-send-btn {
    background: #166DE0;
    color: white;
}

.reply-send-btn:hover {
    background: #1356c4;
}

.reply-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.reply-cancel-btn {
    background: #f1f1f1;
    color: #666;
}

.reply-cancel-btn:hover {
    background: #e6e6e6;
}

/* Reply Messages */
.reply-message {
    background: #f8f9fa;
    border-left: 3px solid #166DE0;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
}

.reply-message-header {
    font-weight: 500;
    color: #166DE0;
    margin-bottom: 4px;
    font-size: 12px;
}

.reply-message-text {
    color: #666;
    line-height: 1.4;
}

/* Mention Styling */
.mention {
    background-color: transparent;
    color: #166DE0;
    padding: 0;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    font-weight: normal;
}

.mention:hover {
    background-color: transparent;
    color: #166DE0;
    text-decoration: none;
}

.mention:focus {
    outline: none;
    color: #166DE0;
}

.message-actions {
    opacity: 0;
    display: flex;
    gap: 2px;
    position: absolute;
    top: -15px;
    right: 20px;
    background-color: var(--mm-chat-area-bg);
    border: 1px solid var(--mm-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s ease;
}

.message-actions .btn {
    border: none;
    background: none;
    color: #666;
    padding: 6px 8px;
    font-size: 12px;
}

.message-actions .btn:hover {
    background-color: var(--mm-hover);
    color: var(--mm-primary);
}

.message-attachment {
    margin-top: 8px;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid var(--mm-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.attachment-file {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.attachment-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.attachment-name {
    font-weight: 500;
    color: #1e325c;
    font-size: 14px;
}

.attachment-size {
    font-size: 12px;
    color: #6c757d;
}

/* Image/Preview Attachments */
.attachment-preview {
    max-width: 300px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--mm-chat-area-bg);
    border: 1px solid var(--mm-border);
}

.attachment-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.attachment-info {
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--mm-border);
}

.attachment-info .attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
}

.attachment-info .attachment-size {
    font-size: 11px;
    color: #6c757d;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 12px;
    opacity: 0.7;
}

.typing-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.typing-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.typing-text {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background-color: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Input */
.message-input-container {
    padding: 15px 20px;
    background-color: #ffffff;
    border-top: 1px solid var(--mm-border);
}

.input-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.input-area {
    display: flex;
    gap: 10px;
    align-items: end;
}

.message-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--mm-border);
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

.message-input:focus {
    border-color: var(--mm-info);
    box-shadow: 0 0 0 0.2rem rgba(7, 193, 228, 0.25);
}

.send-button {
    padding: 8px 12px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #666;
    transition: all 0.2s ease;
}

.send-button:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.send-button:disabled {
    background: transparent;
    color: #ccc;
    border-color: #f0f0f0;
    cursor: not-allowed;
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Voice Call Modal */
.voice-call-modal {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-height: 400px;
}

.voice-call-modal .modal-body {
    padding: 3rem 2rem;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.call-profile {
    margin-bottom: 2rem;
}

.call-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    position: relative;
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid #e9ecef;
}

.call-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.call-action {
    font-size: 1.1rem;
    color: #6c757d !important;
    margin-bottom: 2.5rem;
}

.call-buttons {
    gap: 1.5rem;
}

.call-btn {
    padding: 14px 28px;
    border-radius: 6px;
    font-weight: 400;
    min-width: 110px;
    border: 1px solid;
    transition: all 0.2s ease;
    font-size: 14px;
}

.call-btn:hover {
    transform: none;
    box-shadow: none;
}

.btn-success.call-btn {
    background-color: transparent;
    border-color: #28a745;
    color: #28a745;
}

.btn-success.call-btn:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-secondary.call-btn {
    background-color: transparent;
    border-color: #dc3545;
    color: #dc3545;
}

.btn-secondary.call-btn:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.sidebar-content:hover::-webkit-scrollbar,
.messages-container:hover::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar:hover,
.messages-container::-webkit-scrollbar:hover {
    opacity: 1;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--mm-secondary);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--mm-primary);
}

.messages-container::-webkit-scrollbar-track {
    background: var(--mm-border);
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--mm-secondary);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--mm-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .team-sidebar {
        display: none;
    }
    
    .channel-sidebar {
        width: 280px;
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .channel-sidebar.open {
        transform: translateX(0);
    }
    
    .chat-area {
        width: 100%;
    }
    
    .chat-header {
        padding-left: 50px;
    }
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block !important;
    }
}

/* Enhanced Message Styling */
.message:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.message.own-message .message-content {
    background-color: rgba(7, 193, 228, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    margin-left: 8px;
}

/* Improved Scrollbars */
.sidebar-content::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-content:hover::-webkit-scrollbar,
.messages-container:hover::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar:hover,
.messages-container::-webkit-scrollbar:hover {
    opacity: 1;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--mm-secondary);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--mm-primary);
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Smooth Transitions */
.channel-item,
.team-item,
.message-input,
.btn {
    transition: all 0.2s ease;
}

/* Focus States */
.message-input:focus {
    border-color: var(--mm-info);
    box-shadow: 0 0 0 0.2rem rgba(7, 193, 228, 0.25);
}

/* Dark Mode Support - Chat area remains light */
@media (prefers-color-scheme: dark) {
    :root {
        --mm-chat-area-bg: #ffffff;
        --mm-border: #e6e6e6;
        --mm-hover: #f1f1f1;
    }
    
    body {
        background-color: var(--mm-light);
        color: white;
    }
    
    .chat-area {
        background-color: #ffffff;
    }
    
    .chat-header {
        background-color: #ffffff;
        border-bottom-color: var(--mm-border);
    }
    
    .messages-container {
        background-color: #ffffff;
    }
    
    .message-text {
        color: #2c3e50;
    }
    
    .message-input-container {
        background-color: #ffffff;
        border-top-color: var(--mm-border);
    }
    
    .message-input {
        background-color: #ffffff;
        border-color: var(--mm-border);
        color: #2c3e50;
    }
    
    .message-attachment {
        background-color: #f8f9fa;
        border-color: var(--mm-border);
    }
    
    .day-separator span {
        background-color: #ffffff;
        color: #666;
    }
}

/* Info Panel */
.info-panel {
    background: #ffffff;
    border-left: 1px solid var(--mm-border);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: fixed;
    right: -25%;
    top: 60px;
    width: 25%;
    transition: right 0.3s ease-in-out;
    z-index: 100;
}

.info-panel.active {
    right: 0;
}

.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--mm-border);
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.info-panel-header h5 {
    color: #333333;
    font-weight: 600;
}

.info-panel-content {
    padding: 0;
}

.info-section {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--mm-border);
}

.info-section:last-child {
    border-bottom: none;
}

.section-title {
    color: #333333;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header .btn-link {
    color: #166DE0;
    font-size: 12px;
    text-decoration: none;
}

.section-header .btn-link:hover {
    color: #0d5cb5;
    text-decoration: underline;
}

/* Profile Section */
.profile-section {
    position: relative;
    margin: -1.5rem -1rem 1rem -1rem;
}

.profile-avatar-container {
    position: relative;
    width: 100%;
    height: 300px;
    min-height:250px;
    overflow: hidden;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.profile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1rem 1rem;
    color: white;
}

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.profile-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--mm-online);
}

.profile-status.online::before {
    background-color: var(--mm-online);
}

.profile-status.away::before {
    background-color: var(--mm-away);
}

.profile-status.offline::before {
    background-color: var(--mm-offline);
}

.profile-name {
    color: white;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 18px;
}

.profile-status-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* Information Section */
.info-item {
    margin-bottom: 1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #666666;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

.info-value {
    color: #333333;
    font-size: 14px;
    word-break: break-word;
}

/* Media Section */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.media-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.media-item:hover {
    transform: scale(1.05);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item.placeholder {
    background: #f8f9fa;
    color: #999999;
}

.media-item.placeholder i {
    font-size: 20px;
}

/* Participants Section */
.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.participant-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.participant-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.participant-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-indicator.online {
    background-color: var(--mm-online);
}

.status-indicator.away {
    background-color: var(--mm-away);
}

.status-indicator.offline {
    background-color: var(--mm-offline);
}

.participant-info {
    flex: 1;
    min-width: 0;
}

.participant-name {
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-status {
    color: #666666;
    font-size: 12px;
    text-transform: capitalize;
}

/* Files Section */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.file-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.file-icon {
    font-size: 24px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-details {
    flex: 1;
}

.file-name {
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-meta {
    color: #666666;
    font-size: 12px;
}

.file-item .btn {
    padding: 0.25rem 0.5rem;
    font-size: 12px;
}

/* Mobile responsive styles for Info Panel */
@media (max-width: 768px) {
    .info-panel {
        width: 100% !important;
        right: -100% !important;
        top: 60 !important;
        height: 100vh !important;
        z-index: 1001 !important;
        border-left: none !important;
        box-shadow: none !important;
    }
    
    .info-panel.active {
        right: 0 !important;
    }
    
    .info-panel-header {
        top: 0 !important;
        background: #f8f9fa !important;
        border-bottom: 1px solid var(--mm-border) !important;
    }
}
/* Modal backdrop (optional if you have one) */
.modal-backdrop {
  z-index: 1050 !important; /* Make sure it's below modal but above page */
}

/* Modal itself */
.modal {
  z-index: 1900 !important; /* Higher than backdrop */
}
.btn-primary {
    background-color: #192A4D !important;
    border-color: #192A4D !important;
}

.btn-primary:hover {
    background-color: #0f1c33 !important;
    border-color: #0f1c33 !important;
}

.btn-primary:active,
.btn-primary:focus {
    background-color: #0b1527 !important;
    border-color: #0b1527 !important;
    box-shadow: none !important;
}

/* Custom modal header theme */
.modal-header-primary {
    background-color: #192A4D !important;
    color: #fff !important;
    border-bottom: 1px solid #0f1c33 !important;
}

.modal-header-primary .btn-close {
    filter: brightness(0) invert(1); /* makes the close icon white */
}

.modal-header-primary h5,
.modal-header-primary .modal-title {
    color: #fff !important;
}
/* Global scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.35) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.35);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(125, 211, 252, 0.55);
}

/* Ensure SweetAlert always appears above modals */
.swal2-container {
  z-index: 999999 !important;
}

.swal2-popup {
  z-index: 1000000 !important;
}

/* Optional: ensure backdrop is also above Bootstrap modal */
.swal2-backdrop-show {
  z-index: 999998 !important;
}