.blocked-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    text-align: center;
    margin: 10px;
}
.blocked-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}
.blocked-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}
.message-input:disabled {
    background-color: #f8f9fa !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}
.send-button:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}
.unread-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #e53e3e;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.message-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.image-input {
    display: none;
}
.image-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.image-button:hover {
    background: #e0e0e0;
}
.image-preview-container {
    position: relative;
    margin-bottom: 10px;
    max-width: 200px;
}
.image-preview {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}
.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.remove-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}
.message-input.with-image {
    border-top: 2px solid #007bff;
}
.message-image {
    margin-bottom: 8px;
}
.shared-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.shared-image:hover {
    transform: scale(1.05);
}
.pending-message {
    opacity: 0.8;
    border-left: 3px solid #007bff;
}
.message-status {
    font-size: 12px;
    margin: 4px 0;
    font-style: italic;
}
.status-compressing {
    color: #ffa500;
    animation: pulse 1.5s infinite;
}
.status-sending {
    color: #007bff;
    animation: pulse 1.5s infinite;
}
.status-error {
    color: #dc3545;
}
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}
.cancel-btn {
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.cancel-btn:hover {
    background: #e9ecef;
    color: #495057;
}
@media (max-width: 768px) {
    .cancel-btn {
        width: 100%;
        padding: 12px;
    }
}

/*----------------------------------------------------------
  3. Conversation Controls Styles (from conversation-controls.css)
----------------------------------------------------------*/
.relative {
    position: relative;
}
.gear-button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}
.gear-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}
.conversation-controls-dropdown {
    position: absolute;
    top: 100%;
    right: -30px;
    width: 220px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1300;
    overflow: hidden;
    margin-top: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}
.control-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: right;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--gray-700);
}
.control-option:hover {
    background-color: var(--gray-100);
}
.option-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}
.modal-dialog {
    background: white;
    width: 400px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: zoomIn 0.3s ease-out;
    direction: rtl;
}
.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
}
.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
}
.modal-body {
    padding: 1.5rem 1rem;
}
.report-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}
.report-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.modal-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}
.secondary-btn,
.primary-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}
.secondary-btn {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}
.secondary-btn:hover {
    background: var(--gray-200);
}
.primary-btn {
    background: var(--primary-600);
    color: white;
    border: none;
}
.primary-btn:hover {
    background: var(--primary-700);
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Chat Sidebar and Messages Area */
.conversation-item {
  cursor: pointer;
}
.conversation-item.active {
  background-color: #eef;
}
.msg {
  margin-bottom: .5rem;
}
.msg.incoming { text-align: left; }
.msg .time {
  display: block; font-size: .75rem; color: #666;
}

/* Chat Popup Overlay */
.chat-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}


/* Chat Popup Overlay */
.chat-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
/* Chat Popup Container */
.chat-popup {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 100%;
    max-width: 420px;
    height: 600px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    margin: 0;
    z-index: 1200;
    animation: slideInUp 0.3s ease-out;
}


/* Chat Header */
.chat-popup .header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    border-radius: 12px 12px 0 0;
}

.chat-popup-overlay button[aria-label="Close"] {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* Enhanced Chat Popup Styles */
.chat-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}


/* Responsive adjustments for chat popup on small screens */
@media (max-width: 465px) {
    .chat-popup {
        width: 90%;
        height: 75vh;
        bottom: 1rem;
        right: 1rem;
    }
}

/* scoped to ChatPopup.razor */


/* Header Section */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: visible;
}
.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.chat-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Input Section */
.chat-input-section {
    padding: 20px 24px 24px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}


.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}


.title-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


.status-indicator {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Online status indicators */
.status-indicator.online::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

/* Fallback for default (no online status) */
.status-indicator:not(.online):not(.recently-online):not(.offline)::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: pulse 2s infinite;
}

.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}



/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 4px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 2px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #64748b;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state p {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 500;
}

.empty-state span {
    font-size: 0.9rem;
    opacity: 0.7;
}


/* Conversation List Styles */
.conversation-group {
    margin-bottom: 1rem;
}

.conversation-group-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #4f46e5;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conversation-item {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
}

.conversation-item:hover {
    background: #f8fafc;
    border-color: #667eea;
    transform: translateX(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.conversation-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.conversation-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    color: inherit;
}
.conversation-item {
  cursor: pointer;
}
.conversation-item.active {
  background-color: #eef;
}


.conversation-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: #f8f9fa;
}

.conversation-item.active {
    background: #e9ecef;
}

.conversation-preview {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item.active .conversation-preview {
    color: rgba(255, 255, 255, 0.8);
}

.conversation-time {
    font-size: 0.75rem;
    color: #94a3b8;
    align-self: flex-end;
}

.conversation-item.active .conversation-time {
    color: rgba(255, 255, 255, 0.7);
}

.conversation-title {
    font-weight: 500;
}

.conversation-preview {
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg {
  display: flex;
  margin-bottom: 0.5rem;
}

.msg.incoming {
  justify-content: flex-start;
}


/* Back Button */
.back-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    margin-right: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}
@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message Bubbles */
.msg {
    max-width: 80%;
    padding: 0.8rem;
    border-radius: 1rem;
    position: relative;
}


.message-bubble {
    max-width: 100%;
    min-width: 80px;
    position: relative;
}

.sent .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 6px 20px;
    padding: 14px 18px 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.received .message-bubble {
    background: white;
    color: #1e293b;
    border-radius: 20px 20px 20px 6px;
    padding: 14px 18px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-content {
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
    margin-bottom: 6px;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
    margin-top: 4px;
}

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

.received .message-time {
    color: #64748b;
}
.msg {
  margin-bottom: .5rem;
}
.msg.incoming { text-align: left; }
.msg .time {
  display: block; font-size: .75rem; color: #666;
}

/* Messages Area */

/* Message Bubbles */
.message-wrapper {
    display: flex;
    margin-bottom: 4px;
    animation: messageAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-wrapper.sent {
    justify-content: flex-end;
}

.message-wrapper.received {
    justify-content: flex-start;
}



.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-radius: 20px;
    padding: 6px 6px 6px 20px;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.message-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    padding: 12px 0;
    color: #1e293b;
    font-family: inherit;
}

.message-input::placeholder {
    color: #94a3b8;
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}