/* General container for two-column layout */
.pm-container {
    display: flex;
    gap: 20px;
    margin-left: 0; /* Ensure no left margin */
    padding-left: 0; /* Ensure no left padding */
    width: 100%; /* Ensure full width */
    max-width: 100%; /* Prevent overflow */
    box-sizing: border-box; /* Include padding in width calculation */
    position: relative; /* Enable relative positioning */
    left: 0; /* Align to the left edge */
    height: 80vh; /* Fixed height for the container to enable proper scrolling */
    overflow: hidden; /* Prevent scrolling on the container itself */
}

/* Force alignment with parent containers - works with various WordPress themes */
body .pm-container,
.entry-content .pm-container,
.site-content .pm-container,
.content-area .pm-container,
.post-content .pm-container,
article .pm-container,
.page-content .pm-container,
.wp-block-column .pm-container,
.elementor-widget-container .pm-container {
    margin-left: 0 !important;
    padding-left: 0 !important;
    left: 0 !important;
}

/* Left column (Contacts list) - properly aligned with grey background */
.pm-contacts {
    width: 25%;
    padding: 15px; /* Add padding inside the grey box */
    margin-bottom: 20px;
    margin-left: 0; /* Ensure no left margin */
    background-color: #f3f3f3; /* Grey background */
    border-radius: 8px; /* Rounded corners */
    box-sizing: border-box;
    height: 100%; /* Take full height of parent */
    position: sticky; /* Keep fixed when scrolling */
    top: 0;
    overflow-y: auto; /* Add scroll for contacts if they exceed height */
}

/* Unread toggle styling */
.pm-unread-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 15px; /* Increased from 5px to 15px to add more space */
    padding-bottom: 0; /* Removed padding */
    border-bottom: none; /* Removed separator line */
    padding-left: 0; /* Ensure no left padding for alignment */
}

.pm-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-right: 10px;
}

.pm-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pm-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.pm-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .pm-slider {
    background-color: #BC1752;
}

input:checked + .pm-slider:before {
    transform: translateX(20px);
}

.pm-toggle-label {
    font-size: 14px;
    font-weight: 500;
}

/* Contacts list items (no more pill shape) */
#pm-contacts-list,
.pm-contact-list {
    list-style-type: none; /* Remove bullets */
    padding: 0;
    margin: 0;
}

.pm-contact {
    margin-bottom: 10px; /* Reduced space between contacts */
    padding-left: 0; /* Ensure no left padding */
}

/* Remove any additional padding at the top of the contact list */
#pm-contacts-list > ul:first-child,
.pm-contact-list:first-child {
    margin-top: 0;
    padding-top: 0;
    padding-left: 0; /* Ensure no left padding */
}

.pm-pill {
    display: flex;
    align-items: center;
    background-color: transparent; /* Transparent background to blend with grey box */
    color: #333; /* Darker text for better contrast */
    padding: 10px; /* Adjusted padding */
    padding-left: 0; /* Remove left padding to make flush with toggle */
    border-radius: 4px; /* Subtle rounded corners */
    width: 100%;
    cursor: pointer;
    box-shadow: none; /* Remove shadow */
    justify-content: space-between; /* Space elements across full width */
    transition: background-color 0.2s;
    position: relative; /* Enable positioning context */
}

.pm-avatar, .pm-recipient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

/* Special positioning for AI avatar (Data) - focus on top portion for rectangular images */
.pm-avatar[src*="user-id-ai.jpg"], 
.pm-recipient-avatar[src*="user-id-ai.jpg"],
img[src*="user-id-ai.jpg"] {
    object-position: top center; /* Show the top part of the image (head/face) */
}

/* Contact left side (avatar + info) */
.pm-contact-left {
    display: flex;
    align-items: center;
}

/* New contact info layout */
.pm-contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pm-contact-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
}

.pm-contact-role {
    font-size: 12px;
    color: #777;
    font-weight: normal;
}

/* Unread message indicator */
.pm-unread-indicator {
    display: block;
    width: 14px;
    height: 14px;
    background-color: #BC1752;
    border-radius: 50%;
    border: none;
    flex-shrink: 0; /* Prevent the dot from shrinking */
}

/* Position red dot for better alignment */
.pm-unread-indicator {
    position: static;
    top: auto;
    right: auto;
}

/* Selected contact styling */
.pm-selected-contact .pm-pill {
    background-color: #e8e8e8; /* Darker grey background */
    margin-left: -15px; /* Extend to left edge of container */
    margin-right: -15px; /* Extend to right edge of container */
    padding-left: 15px; /* Restore left padding to align with other contacts */
    padding-right: 15px; /* Restore right padding to align with other contacts */
}

/* Right column (Chat thread) */
.pm-chat-area {
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    height: 100%; /* Take full height of parent */
    overflow: hidden; /* Prevent scrolling on the container itself */
}

/* Message thread container - reduce top padding */
#pm-chat-thread {
    flex: 1; /* Take remaining space */
    overflow-y: auto; /* Enable scrolling for messages */
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    margin-bottom: 10px;
}

/* Date separator styling - reduce top margin */
.pm-date-separator {
    text-align: center;
    margin: 0 0 10px 0; /* Remove top margin, keep bottom margin */
    position: relative;
    padding-top: 15px; /* Add same padding as left column for alignment */
}

.pm-date-separator:first-child {
    margin-top: 0; /* Remove top margin for first date separator */
}

.pm-date-separator span {
    background: transparent;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #54656f;
    display: inline-block;
}

/* Chat input container */
.pm-chat-input-container {
    position: sticky;
    bottom: 0;
    background-color: #fff;
    padding: 10px 0;
    height: 60px; /* Fixed height for input area */
    display: flex;
    align-items: center;
}

/* Chat input styling - updated to match contacts column */
.pm-chat-input {
    display: flex;
    width: 100%;
    background-color: #f3f3f3; /* Match the contacts box color */
    border-radius: 8px; /* Match the contacts box border-radius */
    padding: 8px 16px;
    border: none; /* Remove border for cleaner look */
}

/* Message input area */
#pm-message-content {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    padding: 5px;
    max-height: 40px;
    min-height: 40px;
}

/* Send button */
.send-button {
    background-color: #BC1752;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    margin-left: 8px;
}

/* Action buttons (attach, record) */
.action-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* Remove any shadow */
}

.action-button:hover {
    background-color: #ffffff; /* White background on hover */
    border: 1px solid #000000; /* Black border on hover */
}

.action-icon {
    width: 20px;
    height: 20px;
}

/* Recording overlay styles */
.recording-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 104px);
    display: none;
    align-items: center;
    gap: 8px;
    background: white;
}

.recording-timer-container {
    height: 40px;
    min-width: 300px; /* Set a specific pixel width instead */
    flex: 0 0 auto; /* Don't allow flex to override the width */
    background: #F0F2F5;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recording-indicator {
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.recording-timer {
    font-size: 14px;
    color: #050505;
}

.cancel-recording,
.stop-recording {
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.cancel-recording {
    height: 40px;
    min-width: 80px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background: #E4E6EB;
    color: #050505;
    font-weight: 500;
    cursor: pointer;
}

.stop-recording {
    height: 40px;
    min-width: 80px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    background: #dc3545;
    color: white;
    font-weight: 500;
    cursor: pointer;
    margin-right: 8px;
}

#pm-send-message {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 0 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    min-height: 100%; /* Matches the height of the textarea */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px; /* Keeps the button width reasonable */
}

#pm-send-message:hover {
    background-color: #a31346;
}

.pm-message-bubble {
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    border-bottom: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix extra spacing in message bubbles */
.pm-message-bubble p {
    margin: 0;
    padding: 0;
}

.pm-message-bubble p:not(:last-child) {
    margin-bottom: 8px;
}

/* Prevent message bubbles from splitting into columns - more targeted approach */
.pm-container .pm-chat-area .pm-message-bubble,
.pm-container .pm-chat-thread .pm-message-bubble {
    /* Reset any column properties that might be inherited */
    column-count: 1;
    columns: 1;
    column-width: auto;
    column-gap: normal;
    column-fill: auto;
    column-span: none;
    break-inside: avoid;
    
    /* Ensure proper block layout */
    display: block;
    width: auto;
    max-width: 65%;
    box-sizing: border-box;
    
    /* Ensure text flows properly */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    
    /* Create new stacking context to prevent column inheritance */
    position: relative;
    z-index: 1;
}

/* Also apply to content inside bubbles */
.pm-container .pm-chat-area .pm-message-bubble *,
.pm-container .pm-chat-thread .pm-message-bubble * {
    column-count: 1;
    columns: 1;
    break-inside: avoid;
}

/* Recipient avatar next to their speech bubble - match contact list size */
.pm-recipient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

/* Space between image and bubble */
.pm-message-recipient img.pm-avatar {
    margin-right: 10px;
}

/* Recipient messages (left-aligned) - container for avatar + bubble */
.pm-message-recipient {
    display: flex;
    align-items: flex-start; /* Align avatar to top of message */
    margin: 8px 0;
    max-width: 70%; /* Allow space for avatar */
}

/* The actual message bubble for recipients */
.pm-message-recipient .pm-message-bubble {
    background-color: #f0f0f0; /* Grey background */
    color: #333; /* Darker text for contrast */
    text-align: left;
    flex: 1; /* Take remaining space after avatar */
}

/* Sender messages (right-aligned) - no avatar needed */
.pm-message-sender {
    margin: 8px 0;
    margin-left: auto;
    max-width: 70%;
    display: flex;
    justify-content: flex-end;
}

/* The actual message bubble for senders */
.pm-message-sender .pm-message-bubble {
    background-color: #D4E7F8; /* Keep blue for sender */
    color: #254E6E;
    text-align: right;
}

/* mic and attach button styling */
.pm-chat-input {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

/* File attachment bubble for sender */
.pm-message-sender .file-attachment {
    background-color: #D4E7F8; /* Same as sender bubbles */
    padding: 10px;
    border-radius: 10px;
    max-width: 70%;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    word-wrap: break-word;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.1);
    text-align: right;
    margin-left: auto;
    color: #254E6E;
}

/* File attachment bubble for recipient */
.pm-message-recipient .file-attachment {
    background-color: #f0f0f0; /* Changed from red to grey */
    padding: 10px;
    border-radius: 10px;
    max-width: 70%;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    word-wrap: break-word;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.1);
    text-align: left;
    color: #333; /* Darker text for contrast */
}

/* Attachment icon in the bubble */
.file-attachment img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    object-fit: contain;
}

/* Links to attachments */
.file-attachment a {
    color: inherit;
    text-decoration: underline;
}

/* in thread in line image preview */
.attachment-header {
    padding: 8px 0;
}

.file-name {
    color: #111b21;
    font-size: 14px;
    margin-bottom: 4px;
}

.pdf-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
}

.pdf-type {
    color: #667781;
    font-size: 13px;
}

.pdf-action {
    color: #667781;
    font-size: 13px;
}

.pdf-link {
    text-decoration: none;
    display: block;
}

/* Adjust the attachment icon size */
.attachment-icon {
    width: 30px;  /* Reduced from default size */
    height: 30px;
    display: inline-block;
}

/* Remove any potential border/line styles */
.attachment-header,
.pdf-preview,
.pdf-link,
.file-name {
    border: none;
    border-bottom: none;
    background-image: none;
}

.pm-image-preview {
    max-width: 400px;  /* Increased from 300px */
    max-height: 400px; /* Increased from 300px */
    border-radius: 8px;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Recording interface */
.recording-interface {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.recording-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.recording-indicator {
    width: 12px;
    height: 12px;
    background: #f44336;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.recording-timer {
    font-size: 18px;
    color: #333;
    min-width: 50px;
    font-weight: bold;
}

.recording-actions {
    display: flex;
    gap: 15px;
}

.action-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.action-button.accept-recording {
    background-color: #4CAF50;
}

.action-button.cancel-recording {
    background-color: #f44336;
}

.action-button.accept-recording:hover {
    background-color: #45a049;
}

.action-button.cancel-recording:hover {
    background-color: #da190b;
}

.action-button svg {
    width: 24px;
    height: 24px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#pm-record-voice-note.recording {
    background-color: #ffebee !important;
    border: 2px solid #f44336 !important;
}

.message-file-info {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667781;
    font-size: 0.9em;
    border-bottom: none;
}

.message-file-info i {
    font-size: 1.2em;
}

.image-message img {
    max-width: 300px;
    border-radius: 4px;
}

/* PDF preview */
.pdf-preview:hover {
    background: #f8f9fa;
}

.pdf-icon {
    display: flex;
    align-items: center;
}

.pdf-icon i {
    font-size: 24px;
    color: #667781;
}

.pdf-link:after {
    display: none;
}

.message-file-info {
    margin-bottom: 8px;
}

#record-button {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    border: none;
    background: none;
    color: #667781;
    display: flex;
    align-items: center;
    justify-content: center;
}

#record-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#record-button.recording {
    color: #dc3545;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.recording-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 8px;
}

.recording-timer-container {
    flex: 1;
    width: 90%; 
    height: 40px;
    background: #F0F2F5;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recording-indicator {
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.recording-controls {
    display: flex;
    gap: 8px;
}

.cancel-recording,
.stop-recording {
    padding: 8px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    height: 40px;
    font-weight: 500;
}

.cancel-recording {
    background: #E4E6EB;
    color: #050505;
}

.stop-recording {
    background: #dc3545;
    color: white;
}

.send-button {
    padding: 8px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #dc3545;
    color: white;
    font-weight: 500;
    height: 40px;
}

/* Make sure the container has relative positioning */
.pm-chat-input-container {
    position: relative;
    width: 100%;
}

/* Image message styling */
.pm-image-container {
    position: relative;
    max-width: 70%;
    width: 300px; /* Fixed width */
    height: 300px; /* Fixed height */
    margin: 2px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
}

/* Recipient (left) image container */
.pm-image-container.pm-message-recipient {
    margin-right: auto;
    margin-left: 0;
    border: 2px solid #f0f0f0; /* Gray border for recipient messages */
}

/* Sender (right) image container */
.pm-image-container.pm-message-sender {
    margin-left: auto;
    margin-right: 0;
    border: 2px solid #D4E7F8; /* Blue border for sender messages */
}

/* The actual image that fills the container */
.pm-image-message {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover ensures the image fills the entire container */
    object-position: center; /* Center the image within the container */
}

/* Info icon for image details */
.pm-image-info {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 30px; /* Larger size */
    height: 30px; /* Larger size */
    background-color: rgba(0, 0, 0, 0.6); /* More opaque background */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 2;
}

.pm-image-info i {
    color: white;
    font-size: 16px; /* Larger icon */
}

.pm-image-info:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Tooltip that appears on hover */
.pm-image-tooltip {
    position: absolute;
    bottom: 30px;
    right: 0;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 150px;
    display: none;
    flex-direction: column;
    gap: 5px;
    z-index: 3;
}

.pm-image-info:hover .pm-image-tooltip {
    display: flex;
}

.pm-image-filename {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 4px;
}

.pm-image-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.pm-image-preview,
.pm-image-download {
    color: #4dabf7;
    text-decoration: none;
    font-size: 12px;
    display: block;
}

.pm-image-preview:hover,
.pm-image-download:hover {
    text-decoration: underline;
}

/* Image Overlay */
#pm-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Reduced opacity from 0.9 to 0.6 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#pm-image-overlay-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#pm-image-overlay-content img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

#pm-image-overlay-close {
    position: absolute;
    top: -20px;
    right: -20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px; /* Made consistent */
    height: 32px; /* Made consistent */
    font-size: 20px;
    line-height: 0; /* Reset line height */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0; /* Remove any padding */
    text-align: center;
}

#pm-image-overlay-close:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Audio player styling for message bubbles */
.pm-message-bubble .voice-message {
    width: 100%;
    margin: 0;
    padding: 0;
}

.pm-message-bubble .voice-message audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    outline: none;
    display: block;
    margin: 0;
}

/* Audio message bubble sizing */
.pm-message-bubble .voice-message {
    max-width: 100%;
}

/* Sender audio message (blue background) */
.pm-message-sender .voice-message audio {
    background-color: #D4E7F8;
}

/* Recipient audio message (grey background) */
.pm-message-recipient .voice-message audio {
    background-color: #f0f0f0;
}

/* Audio message styling - completely revised approach */
.pm-message-bubble.voice-message-container {
    padding: 2px;
    box-sizing: border-box;
    max-width: 280px;
    margin: 4px 0;
}

/* Remove default audio player styling */
.voice-message audio {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    outline: none;
    display: block;
    margin: 0;
}

.pm-message-bubble .voice-message {
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Audio player color customization */
.pm-message-sender.voice-message-container {
    background-color: #D4E7F8; /* Blue for sender */
    margin-left: auto;
    margin-right: 0;
}

.pm-message-recipient.voice-message-container {
    background-color: #f0f0f0; /* Grey for recipient */
    margin-right: auto;
    margin-left: 0;
}

/* Ensure consistent text color */
.pm-message-sender.voice-message-container {
    color: #254E6E;
}

.pm-message-recipient.voice-message-container {
    color: #333;
}

/* Force common browser audio styling to match our colors */
.voice-message-container audio::-webkit-media-controls-panel {
    background-color: inherit !important;
}

.voice-message-container audio::-webkit-media-controls-enclosure {
    background-color: inherit !important;
}

/* Basic styling reset for audio across browsers */
audio {
    filter: none;
    -webkit-appearance: none;
}

/* Additional audio styling for Firefox */
@-moz-document url-prefix() {
    .voice-message audio {
        background-color: inherit !important;
    }
}

/* Pagination styles - updated for load more button */
.pm-load-more-container {
    text-align: center;
    margin: 10px 0;
    display: flex;
    justify-content: center;
}

.pm-load-more-btn {
    background-color: transparent !important;
    color: #555;
    border: none !important;
    border-radius: 0;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    box-shadow: none !important;
    text-shadow: none !important;
}

.pm-load-more-btn:hover {
    color: #555; 
    background-color: transparent !important;
    border: none !important;
    font-weight: bold; /* Just make text bold on hover */
}

/* Add up arrow to the left of load more text */
.pm-load-more-btn:before {
    content: "↑"; /* Up arrow character */
    margin-right: 8px;
    font-size: 16px;
}

/* Admin role styling - removing special styling to make Admin look like other roles */
.pm-contact[data-role="Admin"] .pm-contact-role {
    /* Removing specific styling to match other contact roles */
    color: #777; /* Match regular contact role color */
    font-weight: normal; /* Match regular contact role weight */
}

/* Override styles for action buttons to ensure consistency */
button.action-button,
.action-button button,
.pm-chat-input .action-button,
#pm-record-voice-note, 
#pm-attach-file {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

button.action-button:hover,
.action-button button:hover,
.pm-chat-input .action-button:hover,
#pm-record-voice-note:hover, 
#pm-attach-file:hover {
    background-color: #ffffff !important;
    border: 1px solid #000000 !important;
}

/* Ensure Load Previous Messages has correct styling */
.pm-load-more-btn {
    box-shadow: none !important;
    text-shadow: none !important;
    background-color: transparent !important;
    border: none !important;
}

.pm-load-more-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #bc1752;
    border: 2px dotted #BC1752 !important;
}

/* End of minimal CCC Insights styles - Relies on CCC Core for all card styling */

/* ================================================ */
/* AI CONVERSATION STYLES                           */
/* ================================================ */

/* AI Contact Styling - removed special styling to match other users */

/* AI Conversation Container */
.ai-conversation-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

/* AI Welcome Message */
.ai-welcome-message {
    background: linear-gradient(135deg, #E8F4FD 0%, #F0F8FF 100%);
    border: 1px solid #B3D9FF;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.ai-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4A90E2;
    padding: 8px;
}

.ai-welcome-content h3 {
    margin: 0 0 10px 0;
    color: #2C5282;
    font-size: 18px;
    font-weight: 600;
}

.ai-welcome-content p {
    margin: 0 0 15px 0;
    color: #4A5568;
    line-height: 1.5;
}

.ai-examples {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.ai-examples strong {
    color: #2C5282;
    font-size: 14px;
}

.ai-examples ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.ai-examples li {
    color: #4A5568;
    font-size: 13px;
    margin-bottom: 4px;
    font-style: italic;
}

/* AI Conversation History */
.ai-conversation-history {
    flex: 1;
    overflow-y: auto;
    padding: 0 5px;
}

/* AI Conversation Items */
.ai-conversation-item {
    margin-bottom: 20px;
    border-bottom: 1px solid #F1F5F9;
    padding-bottom: 15px;
}

.ai-conversation-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ai-conversation-meta {
    text-align: center;
    margin-bottom: 10px;
}

.ai-conversation-time {
    font-size: 12px;
    color: #718096;
    background: #F7FAFC;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* AI Message Bubbles */
.ai-message-bubble {
    border-radius: 16px;
    padding: 12px 16px;
    max-width: 85%;
    margin: 5px 0;
    line-height: 1.4;
}

.ai-message-bubble.user {
    background: #4A90E2;
    color: white;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.ai-message-bubble.assistant {
    background: #F7FAFC;
    color: #2D3748;
    border: 1px solid #E2E8F0;
    margin-left: 0;
    margin-right: auto;
}

.ai-message-bubble.assistant.error {
    background: #FED7D7;
    border-color: #FC8181;
    color: #C53030;
}

/* AI message content formatting */
.ai-message-bubble p {
    margin: 0 0 8px 0;
}

.ai-message-bubble p:last-child {
    margin-bottom: 0;
}

.ai-message-bubble ul {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message-bubble li {
    margin-bottom: 4px;
}

/* AI Chat Input */
.ai-chat-mode {
    border-top: 2px solid #4A90E2;
    background: linear-gradient(135deg, #F0F8FF 0%, #FFFFFF 100%);
}

.ai-chat-mode .pm-chat-input {
    background: #FFFFFF;
    border: 2px solid #4A90E2;
    border-radius: 12px;
}

#pm-ai-message-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    padding: 12px;
    min-height: 60px;
    max-height: 120px;
    font-size: 14px;
    line-height: 1.4;
}

#pm-ai-message-input::placeholder {
    color: #A0AEC0;
    font-style: italic;
}

.ai-send-btn {
    background: #4A90E2 !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    margin: 8px !important;
    transition: all 0.2s ease;
}

.ai-send-btn:hover {
    background: #357ABD !important;
    transform: translateY(-1px);
}

.ai-send-btn:disabled {
    background: #A0AEC0 !important;
    cursor: not-allowed;
    transform: none;
}

.ai-input-help {
    text-align: center;
    margin-top: 8px;
    padding: 0 12px;
}

.ai-input-help small {
    color: #718096;
    font-size: 12px;
}

/* User and Assistant Message Containers */
.ai-user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.ai-assistant-message {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

/* Responsive Design for AI Interface */
@media (max-width: 768px) {
    .ai-welcome-message {
        flex-direction: column;
        text-align: center;
    }
    
    .ai-avatar {
        align-self: center;
    }
    
    .ai-message-bubble {
        max-width: 95%;
    }
    
    .ai-examples {
        font-size: 12px;
    }
}

/* Animation for new AI messages */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-conversation-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Thinking animation for Kai */
.pm-message-recipient.thinking .pm-message-bubble {
    background: #e3f2fd !important;
    border: 2px dashed #1976d2;
    position: relative;
}

.thinking-animation {
    opacity: 0.7;
}

.thinking-animation::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1976d2;
    animation: thinking-pulse 1.4s infinite ease-in-out both;
    margin-left: 8px;
}

@keyframes thinking-pulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================================================ */
/* AUTOCOMPLETE DROPDOWN STYLES                     */
/* ================================================ */

.pm-autocomplete-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-bottom: 8px;
    display: none;
}

.pm-autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s ease;
}

.pm-autocomplete-item:last-child {
    border-bottom: none;
}

.pm-autocomplete-item:hover,
.pm-autocomplete-item.highlighted {
    background-color: #F0F8FF;
}

.pm-autocomplete-item.highlighted {
    background-color: #E8F4FD;
}

.pm-autocomplete-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E2E8F0;
    flex-shrink: 0;
}

.pm-autocomplete-info {
    flex: 1;
}

.pm-autocomplete-name {
    font-weight: 600;
    color: #2D3748;
    font-size: 14px;
}

.pm-autocomplete-username {
    color: #718096;
    font-size: 12px;
    margin-top: 2px;
}

.pm-autocomplete-role {
    color: #4A5568;
    font-size: 11px;
    font-style: italic;
}

/* Make the input container relative for dropdown positioning */
.pm-chat-input-container {
    position: relative;
}

/* Loading state for autocomplete */
.pm-autocomplete-loading {
    padding: 12px;
    text-align: center;
    color: #718096;
    font-size: 13px;
    font-style: italic;
}

/* No results state */
.pm-autocomplete-no-results {
    padding: 12px;
    text-align: center;
    color: #A0AEC0;
    font-size: 13px;
    font-style: italic;
}

/* Loading state for AI responses */
.ai-message-bubble.loading {
    position: relative;
    color: transparent;
}

.ai-message-bubble.loading::after {
    content: "●●●";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #4A90E2;
    animation: aiTyping 1.4s infinite;
}

@keyframes aiTyping {
    0%, 60%, 100% {
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
}

/* Autocomplete Dropdown */
.pm-autocomplete-dropdown {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 280px;
}

.pm-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.pm-autocomplete-item:hover {
    background-color: #f5f5f5;
}

.pm-autocomplete-item:last-child {
    border-bottom: none;
}

.pm-autocomplete-item[data-type="knowledge"] {
    background-color: #fafbfc;
}

.pm-autocomplete-item[data-type="knowledge"]:hover {
    background-color: #f0f4f8;
}

.pm-autocomplete-separator {
    padding: 6px 12px;
    background-color: #e8f0fe;
    color: #1565c0;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ddd;
}

.pm-autocomplete-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.pm-autocomplete-info {
    flex: 1;
}

.pm-autocomplete-name {
    font-weight: bold;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pm-autocomplete-username {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.pm-autocomplete-role {
    font-size: 11px;
    color: #999;
    margin-top: 1px;
}

.pm-autocomplete-no-results {
    padding: 12px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* START CCC-70 — lightweight toast (no Core dependency) */
#pm-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    z-index: 100000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
    color: #fff;
    background: #333;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#pm-toast.pm-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

#pm-toast.pm-toast-error {
    background: #8b2e2e;
}

#pm-toast.pm-toast-success {
    background: #2f6b45;
}

#pm-toast.pm-toast-info {
    background: #2f4f6b;
}
/* END CCC-70 */
