﻿/* messaging.css - Messaging module, rich text toolbar */

/* ==================== MESSAGING MODULE ==================== */
#page-messaging {
    padding: 1rem;
    padding-bottom: 0;
}

.messaging-page {
    display: flex;
    height: calc(100vh - var(--header-height) - 1rem - 50px);
    height: calc(100dvh - var(--header-height) - 1rem - 50px);
    background: #fff;
    border-radius: 1rem 1rem 0 0;
    box-shadow: var(--eff-shadow);
    overflow: hidden;
}

/* Messaging Sidebar / Conversations List */
.messaging-sidebar {
    width: 360px;
    min-width: 360px;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
}

.messaging-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
}

.messaging-sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    color: #1f2937;
    font-size: 1.1rem;
}

.unread-count {
    background: var(--eff-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 1rem;
}

.messaging-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.new-message-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--eff-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.new-message-btn:hover {
    background: var(--eff-primary-dark);
    transform: scale(1.05);
}

/* New Message Modal Styles */
.new-msg-claim-search {
    position: relative;
    margin-bottom: 0.5rem;
}

.new-msg-claim-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.new-msg-claim-search input {
    padding-left: 38px;
}

.new-msg-claim-results {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background: #fafbfc;
}

.new-msg-claim-results:empty {
    display: none;
}

/* Claim conversation indicator */
.claim-conv-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #dbeafe;
    color: #3b82f6;
    border-radius: 50%;
    font-size: 0.65rem;
    margin-left: 0.25rem;
}

.new-msg-claim-item.has-conversation {
    background: linear-gradient(90deg, #f0f9ff 0%, transparent 100%);
    border-left: 3px solid #3b82f6;
}

.new-msg-claim-item.has-conversation:hover {
    background: linear-gradient(90deg, #dbeafe 0%, #f0fdf4 100%);
}

/* Existing conversation notice */
.existing-conv-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 1px solid #93c5fd;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
}

.existing-conv-notice > i {
    font-size: 1.75rem;
    color: #3b82f6;
    margin-top: 0.125rem;
}

.existing-conv-notice .notice-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.existing-conv-notice .notice-text strong {
    color: #1e40af;
    font-size: 0.95rem;
}

.existing-conv-notice .notice-text span {
    color: #3b82f6;
    font-size: 0.85rem;
}

.new-msg-claim-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: background 0.15s ease;
}

.new-msg-claim-item:last-child {
    border-bottom: none;
}

.new-msg-claim-item:hover {
    background: #f0fdf4;
}

.new-msg-claim-item .claim-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.new-msg-claim-item .claim-item-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.new-msg-claim-item .claim-item-details i {
    color: #9ca3af;
    font-size: 0.7rem;
}

.new-msg-claim-item .claim-id {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--eff-primary);
    background: rgba(34, 197, 94, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.new-msg-claim-item .claim-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.new-msg-claim-item .claim-status,
.new-msg-claim-item .status-badge.small {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.new-msg-selected-claim {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border: 1px solid var(--eff-primary);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.selected-claim-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selected-claim-info > span:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selected-claim-id {
    font-weight: 600;
    color: var(--eff-primary);
}

.selected-claim-name {
    font-weight: 500;
    color: #374151;
}

.selected-claim-extra {
    font-size: 0.8rem;
    color: #6b7280;
}

.selected-claim-extra .claim-fh,
.selected-claim-extra .claim-ins {
    font-size: 0.8rem;
}

/* Claims table message button - Base styles */
.claim-msg-btn {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* STATE 1: No conversation - Gray outline, dashed border */
.claim-msg-btn.claim-msg-new {
    background: transparent;
    border: 1.5px dashed #9ca3af;
    color: #9ca3af;
}

.claim-msg-btn.claim-msg-new:hover {
    background: #f3f4f6;
    border-color: #6b7280;
    color: #6b7280;
    border-style: solid;
}

.claim-msg-btn.claim-msg-new i {
    font-size: 0.8rem;
}

/* STATE 2: Has conversation (no unread) - Blue filled */
.claim-msg-btn.claim-msg-active {
    background: #3b82f6;
    border: none;
    color: white;
}

.claim-msg-btn.claim-msg-active:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.claim-msg-btn.claim-msg-active i {
    font-size: 0.85rem;
}

/* STATE 3: Has unread messages - Orange/Yellow with badge and pulse */
.claim-msg-btn.claim-msg-unread {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: white;
    animation: pulse-unread 1.5s infinite;
}

.claim-msg-btn.claim-msg-unread:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: scale(1.1);
    animation: none;
}

.claim-msg-btn.claim-msg-unread i {
    font-size: 0.85rem;
}

.claim-msg-btn .claim-msg-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 700;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes pulse-unread {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
}

.new-msg-no-results {
    padding: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

.messaging-search {
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.messaging-search i {
    color: #9ca3af;
    font-size: 0.9rem;
}

.messaging-search input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.9rem;
    background: transparent;
}

.messaging-search input::placeholder {
    color: #9ca3af;
}

.messaging-filters {
    padding: 0.75rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
}

.msg-filter-btn {
    padding: 0.4rem 0.9rem;
    border: 1px solid #e9ecef;
    border-radius: 2rem;
    background: #fff;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.msg-filter-btn:hover {
    border-color: var(--eff-primary);
    color: var(--eff-primary);
}

.msg-filter-btn.active {
    background: var(--eff-primary);
    border-color: var(--eff-primary);
    color: #fff;
}

.msg-filter-btn.active .unread-filter-count {
    background: #fff;
    color: var(--eff-primary);
}

.unread-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    background: var(--eff-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
}

.unread-filter-count:empty {
    display: none;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f1f3;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    gap: 0.75rem;
}

.conversation-item:hover {
    background: #f3f4f6;
}

.conversation-item.active {
    background: #e8f5e9;
    border-left: 3px solid var(--eff-primary);
}

.conversation-item.unread {
    background: #fefefe;
}

.conversation-item.unread .conv-preview {
    font-weight: 600;
    color: #1f2937;
}

.conv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--eff-primary) 0%, var(--eff-primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.conv-avatar.staff {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.conv-content {
    flex: 1;
    min-width: 0;
}

.conv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.conv-claim-id {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--eff-primary);
    background: var(--eff-primary-light);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
}

.conv-time {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
}

.conv-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-preview {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conv-preview .staff-badge {
    font-size: 0.65rem;
    color: #3b82f6;
    font-weight: 600;
}

.conv-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.conv-started {
    font-size: 0.7rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.conv-started i {
    font-size: 0.6rem;
}

.conv-indicators {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.conv-unread-badge {
    background: var(--eff-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 1rem;
    min-width: 18px;
    text-align: center;
}

.conv-starred {
    color: #f59e0b;
    font-size: 0.75rem;
}

/* Messaging Main Panel */
.messaging-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 0; /* Allow flex child to shrink below content size */
    overflow: hidden;
}

.messaging-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
}

.messaging-empty i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.messaging-empty h4 {
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.messaging-empty p {
    font-size: 0.9rem;
}

/* Chat Panel */
.messaging-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex child to shrink below content size */
    overflow: hidden;
}

.chat-header {
    padding: 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.chat-header-top {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f1f3;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-claim-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--eff-primary);
    background: var(--eff-primary-light);
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
}

.chat-header-details h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

/* Chat Claim Details Row */
.chat-claim-details {
    padding: 0.75rem 1.5rem;
    background: #fff;
}

.chat-claim-info-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.chat-claim-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.chat-stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
}

.chat-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1f2937;
}

.chat-claim-info-row .btn {
    margin-left: auto;
}

/* Compact Chat Header - Single Row */
.chat-header-compact {
    flex-direction: row !important;
    padding: 0.75rem 1rem !important;
    align-items: center;
}

.chat-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.chat-header-compact .chat-claim-badge {
    flex-shrink: 0;
}

.chat-header-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.chat-header-name > span:first-child {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.chat-header-divider {
    color: #d1d5db;
    font-weight: 300;
}

.chat-funeral-home {
    color: #6b7280;
    font-size: 0.85rem;
}

.chat-stat-inline {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
}

.chat-stat-inline strong {
    color: #9ca3af;
    font-weight: 500;
}

.chat-header-compact .chat-header-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.chat-header-details span {
    font-size: 0.8rem;
    color: #6b7280;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e9ecef;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-action-btn:hover {
    background: #f3f4f6;
    color: var(--eff-primary);
    border-color: var(--eff-primary);
}

.chat-action-btn.starred i {
    color: #f59e0b;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8f9fa;
    min-height: 0; /* Allow flex child to shrink and enable scrolling */
}

.message-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-date-divider {
    text-align: center;
    padding: 1rem 0;
}

.message-date-divider span {
    background: #e9ecef;
    color: #6b7280;
    font-size: 0.75rem;
    padding: 0.35rem 1rem;
    border-radius: 1rem;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 75%;
}

.message.outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.message.incoming .message-avatar {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
}

.message.outgoing .message-avatar {
    background: linear-gradient(135deg, var(--eff-primary) 0%, var(--eff-primary-dark) 100%);
    color: #fff;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.message.outgoing .message-sender {
    text-align: right;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.incoming .message-bubble {
    background: #fff;
    color: #1f2937;
    border: 1px solid #e9ecef;
    border-top-left-radius: 0.25rem;
}

.message.outgoing .message-bubble {
    background: var(--eff-primary);
    color: #fff;
    border-top-right-radius: 0.25rem;
}

.message-time {
    font-size: 0.7rem;
    color: #9ca3af;
}

.message.outgoing .message-time {
    text-align: right;
}

/* Chat Input */
.chat-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: #f3f4f6;
    border-radius: 1.5rem;
    padding: 0.5rem;
}

.chat-attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-attach-btn:hover {
    background: #e9ecef;
    color: var(--eff-primary);
}

.chat-input-wrapper textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    max-height: 120px;
    font-family: inherit;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--eff-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    background: var(--eff-primary-dark);
    transform: scale(1.05);
}

/* ==================== RICH TEXT EDITOR TOOLBAR ==================== */
.chat-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0.75rem 0.75rem 0 0;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #d1d5db;
    margin: 0 0.375rem;
}

.toolbar-spacer {
    flex: 1;
}

.toolbar-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    position: relative;
}

.toolbar-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.toolbar-btn:active,
.toolbar-btn.active {
    background: #d1d5db;
    color: var(--eff-primary);
}

.toolbar-btn .color-indicator {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    border-radius: 2px;
}

.toolbar-btn.clear-btn {
    color: #9ca3af;
}

.toolbar-btn.clear-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Toolbar Dropdowns */
.toolbar-dropdown {
    position: relative;
}

.color-picker-dropdown,
.emoji-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    padding: 0.5rem;
    z-index: 100;
    display: none;
}

.color-picker-dropdown.show,
.emoji-picker-dropdown.show {
    display: block;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border: 2px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #374151;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.emoji-btn:hover {
    background: #f3f4f6;
    transform: scale(1.15);
}

/* Rich Text Input Area */
.chat-input-area {
    padding: 0 !important;
    border-top: 1px solid #e9ecef;
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    flex-shrink: 0; /* Prevent input area from shrinking - always visible at bottom */
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    background: #f3f4f6;
    border-radius: 0;
    padding: 0.75rem;
}

.rich-text-input {
    flex: 1;
    min-height: 60px;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rich-text-input:focus {
    border-color: var(--eff-primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.rich-text-input:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}

.rich-text-input table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.rich-text-input table td,
.rich-text-input table th {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    min-width: 60px;
}

.rich-text-input table th {
    background: #f3f4f6;
    font-weight: 600;
}

.rich-text-input ul,
.rich-text-input ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.rich-text-input hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 0.75rem 0;
}


/* Message content with rich formatting */
.message-bubble .rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.8rem;
}

.message-bubble .rich-content table td,
.message-bubble .rich-content table th {
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.35rem 0.5rem;
}

.message-bubble.staff .rich-content table td,
.message-bubble.staff .rich-content table th {
    border-color: #d1d5db;
}

.message-bubble .rich-content ul,
.message-bubble .rich-content ol {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
}

.message-bubble .rich-content hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.3);
    margin: 0.5rem 0;
}

.message-bubble.staff .rich-content hr {
    border-color: #d1d5db;
}


/* Responsive */
@media (max-width: 992px) {
    .messaging-page {
        flex-direction: column;
        height: calc(100vh - var(--header-height) - 1rem - 50px);
        height: calc(100dvh - var(--header-height) - 1rem - 50px);
    }

    .messaging-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 40vh;
        flex-shrink: 0;
    }

    .messaging-main {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
}
