/* ========== My Messages Modal Styles ========== */
.my-messages-modal-overlay {
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 60000;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
    transition: background 0.4s ease-out, backdrop-filter 0.4s ease-out, visibility 0s linear 0.4s;
}

.my-messages-modal-overlay.show {
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    transition: background 0.4s ease-out, backdrop-filter 0.4s ease-out, visibility 0s linear 0s;
}

.my-messages-modal {
    width: 900px;
    max-width: 95vw;
    background: #ffffff;
    border-radius: 16px;
    position: relative;
    overflow: visible;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

.my-messages-modal-overlay.show .my-messages-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.my-messages-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.my-messages-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.my-messages-modal-close {
    background: #f5f5f5;
    color: #666;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-messages-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.my-messages-modal-body {
    overflow: hidden;
    padding: 8px 0;
    height: 500px;
    min-height: 280px;
    display: flex;
}

.my-messages-list-empty {
    padding: 40px 24px;
    text-align: center;
    color: #888;
    opacity: 0;
    transform: scale(0.95);
    animation: myMessagesEmptyIn 0.5s ease 0.1s forwards;
}

@keyframes myMessagesEmptyIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.my-messages-list-empty svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

/* My Messages Tabs */
.my-messages-tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    padding: 0 24px;
    gap: 0;
    background: #fafafa;
}

.my-messages-tab {
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border: none;
    background: transparent;
    position: relative;
    transition: color 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.my-messages-tab:hover {
    color: #555;
}

.my-messages-tab.active {
    color: #11a191;
}

.my-messages-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #11a191;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.my-messages-tab.active::after {
    transform: scaleX(1);
}

.my-messages-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.my-messages-tab-content.active {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Two-column layout for messages */
.my-messages-left-panel {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid #e8e8e8;
    background: #fafafa;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.my-messages-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* Chat display area */
.my-messages-chat-display {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.my-messages-chat-messages {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Delete animation for chat messages */
@keyframes messageDeleteFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateX(20px);
    }
}

@keyframes messageDeleteCollapse {
    0% {
        max-height: var(--message-height);
        margin-bottom: 0;
        opacity: 0;
    }
    100% {
        max-height: 0;
        margin-bottom: -12px;
        opacity: 0;
        padding: 0;
    }
}

.my-messages-chat-row.deleting-fade {
    animation: messageDeleteFade 0.25s ease-out forwards;
}

.my-messages-chat-row.deleting-collapse {
    animation: messageDeleteCollapse 0.3s ease-out forwards;
    overflow: hidden;
}

.my-messages-chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.my-messages-chat-bubble:hover {
    transform: scale(1.02);
}

.my-messages-chat-bubble.sent:hover {
    box-shadow: 0 4px 12px rgba(17, 161, 145, 0.25);
}

.my-messages-chat-bubble.received:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.my-messages-chat-bubble.context-active {
    animation: messagePulse 0.3s ease;
}

@keyframes messagePulse {
    0% { transform: scale(1); }
    30% { transform: scale(0.96); }
    60% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.my-messages-chat-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #11a191 0%, #0d8a7c 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.my-messages-chat-bubble.received {
    align-self: flex-start;
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.my-messages-chat-bubble .message-text {
    margin-bottom: 4px;
}

.my-messages-chat-bubble .message-time {
    font-size: 0.65rem;
    opacity: 0.7;
    text-align: right;
}

.my-messages-chat-bubble.sent .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.my-messages-chat-bubble.received .message-time {
    color: #888;
}

/* Chat message row with avatar */
.my-messages-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 80%;
}

.my-messages-chat-row.grouped {
    margin-bottom: -8px;
}

.my-messages-chat-avatar-placeholder {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    visibility: hidden;
}

.my-messages-chat-row.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.my-messages-chat-row.received {
    align-self: flex-start;
}

.my-messages-chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.my-messages-chat-row.received .my-messages-chat-avatar {
    cursor: pointer;
}

.my-messages-chat-row.received .my-messages-chat-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.my-messages-chat-row.received .my-messages-chat-avatar:active {
    transform: scale(0.95);
}

/* Avatar profile popup */
.chat-avatar-popup {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 8px;
    z-index: 70000;
    animation: avatarPopupIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes avatarPopupIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-avatar-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    border-radius: 8px;
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}

.chat-avatar-popup-item:hover {
    background: #f0f9f8;
    color: #11a191;
}

.chat-avatar-popup-item:active {
    transform: scale(0.98);
}

.chat-avatar-popup-item svg {
    width: 16px;
    height: 16px;
    color: #11a191;
}

.my-messages-chat-row .my-messages-chat-bubble {
    max-width: 100%;
}

/* Chat context menu */
.chat-context-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    min-width: 140px;
    z-index: 70000;
    animation: contextMenuPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top left;
}

@keyframes contextMenuPop {
    0% {
        opacity: 0;
        transform: scale(0.6) translateY(-8px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02) translateY(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #333;
    transition: background 0.15s, transform 0.15s, padding-left 0.15s;
}

.chat-context-menu-item:hover {
    background: #f5f5f5;
    padding-left: 22px;
}

.chat-context-menu-item:active {
    transform: scale(0.98);
}

.chat-context-menu-item.delete {
    color: #e74c3c;
}

.chat-context-menu-item.delete:hover {
    background: #fef0ef;
}

.chat-context-menu-item svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s;
}

.chat-context-menu-item:hover svg {
    transform: scale(1.1);
}

/* Emoji reaction menu */
.chat-emoji-menu {
    position: fixed;
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 8px 14px;
    display: flex;
    gap: 6px;
    z-index: 70000;
    animation: emojiMenuPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes emojiMenuPop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-emoji-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 50%;
    border: none;
    background: transparent;
    transition: background 0.15s, transform 0.15s;
    animation: emojiBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.chat-emoji-btn:nth-child(1) { animation-delay: 0.02s; }
.chat-emoji-btn:nth-child(2) { animation-delay: 0.06s; }
.chat-emoji-btn:nth-child(3) { animation-delay: 0.10s; }
.chat-emoji-btn:nth-child(4) { animation-delay: 0.14s; }
.chat-emoji-btn:nth-child(5) { animation-delay: 0.18s; }

@keyframes emojiBounceIn {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-30deg);
    }
    60% {
        transform: scale(1.15) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.chat-emoji-btn:hover {
    background: #f0f0f0;
    transform: scale(1.2);
}

.chat-emoji-btn:active {
    transform: scale(0.9);
}

.chat-emoji-btn.selected {
    background: #e8f5f3;
    border: 2px solid #11a191;
    transform: scale(1.1);
    animation: none;
}

.chat-emoji-btn.selected:hover {
    background: #d4edea;
    transform: scale(1.15);
}

/* Message reactions display */
.message-reactions {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}

.my-messages-chat-bubble.received .message-reactions {
    right: auto;
    left: -8px;
}

.message-reaction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    background: white;
    border-radius: 10px;
    padding: 2px 5px;
    font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    animation: reactionPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes reactionPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-20deg);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.message-reaction.removing {
    animation: reactionRemove 0.25s ease-out forwards;
}

@keyframes reactionRemove {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(20deg);
    }
}

.message-reaction-emoji {
    font-size: 0.9rem;
    line-height: 1;
}

/* Edit message input */
.message-edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #11a191;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 6px;
}

.message-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.message-edit-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.message-edit-btn.save {
    background: #11a191;
    color: white;
}

.message-edit-btn.save:hover {
    background: #0d8a7c;
}

.message-edit-btn.cancel {
    background: #e0e0e0;
    color: #333;
}

.message-edit-btn.cancel:hover {
    background: #d0d0d0;
}

.message-edited-indicator {
    font-size: 0.6rem;
    opacity: 0.6;
    margin-left: 4px;
}

/* Unread indicator */
.my-messages-user-item {
    position: relative;
}

.unread-indicator {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #11a191;
    border-radius: 50%;
    animation: pulse-unread 2s ease-in-out infinite;
}

@keyframes pulse-unread {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.2); opacity: 0.8; }
}

/* Chat notification toast */
.chat-notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    cursor: pointer;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    max-width: 350px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid #11a191;
}

.chat-notification-toast.show {
    transform: translateX(0);
}

.chat-notification-toast:hover {
    background: #f0f9f8;
    border-left-color: #0d8a7c;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.chat-notification-toast.hiding {
    transform: translateX(120%);
}

.chat-toast-content {
    flex: 1;
    cursor: pointer;
}

.chat-toast-content strong {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 4px;
}

.chat-toast-content p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.3;
}

.chat-toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.chat-toast-close:hover {
    color: #333;
}

/* Chat input area */
.my-messages-chat-input-container {
    width: 100%;
    padding: 12px 16px;
    background: #f8f8f8;
    border-top: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.my-messages-chat-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.my-messages-chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.my-messages-chat-input:focus {
    border-color: #11a191;
    box-shadow: 0 0 0 2px rgba(17, 161, 145, 0.1);
}

.my-messages-chat-input::placeholder {
    color: #aaa;
}

.my-messages-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #11a191 0%, #0d8a7c 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(17, 161, 145, 0.3);
    position: relative;
}

.my-messages-send-btn:hover:not(.locked) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(17, 161, 145, 0.4);
}

.my-messages-send-btn:active:not(.locked) {
    transform: scale(0.95);
}

.my-messages-send-btn.locked {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.my-messages-send-btn svg {
    width: 18px;
    height: 18px;
}

/* Voice button */
.my-messages-voice-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #009688 0%, #00796b 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 150, 136, 0.3);
    position: relative;
}

.my-messages-voice-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.4);
}

.my-messages-voice-btn:active {
    transform: scale(0.95);
}

.my-messages-voice-btn.recording {
    background: linear-gradient(135deg, #e63946 0%, #c82333 100%);
    box-shadow: 0 2px 12px rgba(230, 57, 70, 0.4);
    animation: chat-pulse-record 1.5s ease-in-out infinite;
}

.my-messages-voice-btn.not-supported {
    background: #bbb;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.my-messages-voice-btn svg {
    width: 18px;
    height: 18px;
}

.my-messages-voice-btn.recording svg {
    animation: chat-mic-bounce 0.5s ease-in-out infinite alternate;
}

@keyframes chat-pulse-record {
    0%, 100% { box-shadow: 0 2px 12px rgba(230, 57, 70, 0.4); }
    50% { box-shadow: 0 2px 20px rgba(230, 57, 70, 0.6); }
}

@keyframes chat-mic-bounce {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* Voice button wrapper */
.my-messages-voice-btn-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Voice wave animation */
.my-messages-voice-wave {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 3px;
    align-items: flex-end;
    padding: 6px 10px;
    background: rgba(230, 57, 70, 0.1);
    border-radius: 10px;
    z-index: 10;
}

.my-messages-voice-wave.active {
    display: flex;
}

.my-messages-voice-wave-bar {
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, #e63946 0%, #ff6b7a 100%);
    border-radius: 2px;
    animation: chat-wave-dance 0.5s ease-in-out infinite;
}

.my-messages-voice-wave-bar:nth-child(1) { animation-delay: 0s; height: 10px; }
.my-messages-voice-wave-bar:nth-child(2) { animation-delay: 0.1s; height: 14px; }
.my-messages-voice-wave-bar:nth-child(3) { animation-delay: 0.2s; height: 18px; }
.my-messages-voice-wave-bar:nth-child(4) { animation-delay: 0.3s; height: 12px; }
.my-messages-voice-wave-bar:nth-child(5) { animation-delay: 0.4s; height: 16px; }

@keyframes chat-wave-dance {
    0%, 100% { transform: scaleY(0.5); opacity: 0.7; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* Voice status */
.my-messages-voice-status {
    position: absolute;
    bottom: 55px;
    right: 0;
    background: rgba(33, 33, 33, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.my-messages-voice-status.visible {
    opacity: 1;
    transform: translateY(0);
}

.my-messages-voice-status::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(33, 33, 33, 0.95);
}

/* Button tooltips */
.my-messages-voice-btn::before,
.my-messages-send-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 33, 33, 0.95);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.my-messages-voice-btn::after,
.my-messages-send-btn::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(33, 33, 33, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.my-messages-voice-btn:hover::before,
.my-messages-voice-btn:hover::after,
.my-messages-send-btn:hover::before,
.my-messages-send-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

.my-messages-voice-btn.recording::before,
.my-messages-voice-btn.recording::after {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Search box in left panel */
.my-messages-search-container {
    padding: 12px;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
    z-index: 10;
}

.my-messages-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: visible;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.my-messages-search-wrapper:focus-within {
    border-color: #11a191;
    box-shadow: 0 0 0 2px rgba(17, 161, 145, 0.1);
}

.my-messages-search-input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 0.75rem;
    outline: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    min-width: 0;
}

.my-messages-search-input::placeholder {
    color: #aaa;
}

.my-messages-search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: #ccc;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 12px;
    color: #fff;
    line-height: 1;
    transition: background 0.2s ease;
}

.my-messages-search-clear-btn:hover {
    background: #999;
}

.my-messages-search-clear-btn.visible {
    display: flex;
}

.my-messages-search-dropdown-btn {
    background: transparent;
    border: none;
    border-left: 1px solid #e8e8e8;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.my-messages-search-dropdown-btn:hover {
    background: #f5f5f5;
}

.my-messages-search-dropdown-btn svg {
    width: 16px;
    height: 16px;
    color: #888;
    transition: transform 0.2s ease;
}

.my-messages-search-dropdown-btn.open svg {
    transform: rotate(180deg);
}

/* Dropdown list */
.my-messages-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.my-messages-search-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

.my-messages-search-dropdown-empty {
    padding: 20px 16px;
    text-align: center;
    color: #aaa;
    font-size: 0.8rem;
}

/* Main panel conference search dropdown styles */
.my-messages-main-search-container {
    width: 100%;
    padding: 10px 40px 20px 40px;
    display: flex;
    justify-content: stretch;
    align-items: flex-start;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

.my-messages-main-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: visible;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    flex: 1;
}

.my-messages-main-search-wrapper:focus-within {
    border-color: #11a191;
    box-shadow: 0 0 0 2px rgba(17, 161, 145, 0.1);
}

.my-messages-main-search-input {
    flex: 1;
    border: none;
    padding: 9.5px 14px;
    font-size: 0.85rem;
    outline: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    min-width: 0;
}

.my-messages-main-search-input::placeholder {
    color: #aaa;
}

.my-messages-main-search-icon {
    width: 16px;
    height: 16px;
    color: #aaa;
    margin-left: 12px;
    flex-shrink: 0;
}

.my-messages-main-search-clear-btn {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0 8px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.my-messages-main-search-clear-btn:hover {
    color: #666;
}

.my-messages-main-search-clear-btn.visible {
    display: flex;
}

.my-messages-main-search-dropdown-btn {
    background: transparent;
    border: none;
    border-left: 1px solid #e8e8e8;
    padding: 9.5px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.my-messages-main-search-dropdown-btn:hover {
    background: #f5f5f5;
}

.my-messages-main-search-dropdown-btn svg {
    width: 18px;
    height: 18px;
    color: #888;
    transition: transform 0.2s ease;
}

.my-messages-main-search-dropdown-btn.open svg {
    transform: rotate(180deg);
}

/* Main panel dropdown list */
.my-messages-main-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.my-messages-main-search-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

/* Conference dropdown item styles */
.conference-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.conference-dropdown-item:last-child {
    border-bottom: none;
}

.conference-dropdown-item:hover {
    background: #f8f9fa;
}

.conference-dropdown-item.selected {
    background: #e8f5f3;
}

.conference-dropdown-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.conference-dropdown-details {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.conference-dropdown-location,
.conference-dropdown-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.conference-dropdown-location svg,
.conference-dropdown-date svg {
    width: 12px;
    height: 12px;
    color: #999;
    flex-shrink: 0;
}

.conference-dropdown-text {
    display: inline;
}

.conference-dropdown-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.conference-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.conference-dropdown-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e8e8e8;
    border-top-color: #11a191;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

/* Adjust main content to have vertical layout */
#myConferencesTab .my-messages-main-content {
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

/* Chat display area for My Conferences tab */
#myConferencesChatDisplayArea {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#myConferencesChatDisplayArea .my-messages-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#myConferencesChatDisplayArea .my-messages-list-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    text-align: center;
    padding: 40px;
}

/* User list in Chat History left panel */
.my-messages-user-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.my-messages-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.my-messages-user-item:hover {
    background: #f5f5f5;
}

.my-messages-user-item.active {
    background: #e8f5f3;
    border-left: 3px solid #11a191;
}

.my-messages-user-item.no-conversation {
    opacity: 0.6;
}

.my-messages-user-item.no-conversation .my-messages-user-name {
    color: #888;
}

.my-messages-user-item.no-conversation .my-messages-user-affiliation {
    color: #bbb;
}

.my-messages-user-item.no-conversation:hover {
    opacity: 0.8;
}

.my-messages-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #e0e0e0;
}

.my-messages-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.my-messages-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-messages-user-affiliation {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-messages-no-users {
    padding: 30px 16px;
    text-align: center;
    color: #aaa;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.my-messages-no-users svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.my-messages-add-connections-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #11a191 0%, #0d8a7c 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(17, 161, 145, 0.3);
}

.my-messages-add-connections-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 161, 145, 0.4);
}

.my-messages-add-connections-btn:active {
    transform: translateY(0);
}

.my-messages-loading {
    padding: 30px 16px;
    text-align: center;
    color: #aaa;
    font-size: 0.8rem;
}

.my-messages-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top-color: #11a191;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Search highlight styling */
.my-messages-highlight {
    color: #11a191;
    font-weight: 600;
    background: transparent;
}

/* Mobile styles for My Messages modal */
@media screen and (max-width: 480px) {
    .my-messages-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        position: fixed;
        bottom: 0;
        transform: translateY(100%);
    }

    .my-messages-modal-overlay.show .my-messages-modal {
        transform: translateY(0);
    }
    
    .my-messages-modal-body {
        height: 440px;
    }
    
    .my-messages-left-panel {
        width: 80px;
        min-width: 80px;
    }
}

/* Enable messaging icon styles */
.messaging-icon.enabled {
    cursor: pointer !important;
    opacity: 1 !important;
}

.messaging-icon.enabled:hover {
    color: #11a191 !important;
}

.messaging-icon.enabled svg {
    opacity: 1 !important;
}

/* Messaging unread badge */
.messaging-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff4757 0%, #e84118 100%);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
    pointer-events: none;
    z-index: 10;
}

.messaging-badge.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}
