.conversations-widget {
    background: transparent;
    border-radius: 0;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: none;
}

.conversations-widget-header {
    background: transparent;
    padding: 8px 15px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversations-widget-title {
    font-size: medium;
    font-weight: 600;
    color: #374151;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conversations-widget-content {
    padding: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-bottom: none;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background: transparent;
    margin-bottom: 2px;
}

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

.conversation-item.active {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    padding-left: 12px;
}

.conversation-item.active:hover {
    background: #e1f5fe;
}

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

.conversation-avatar {
    width: 28px;
    height: 28px;
    background: #e5e7eb;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 10px;
    position: relative;
    border: 1px solid #d1d5db;
}

.conversation-avatar.active {
    background: #bbdefb;
    border-color: #2196f3;
}

.conversation-avatar-text {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    line-height: 1;
}

.conversation-avatar.active .conversation-avatar-text {
    color: #1565c0;
}

.conversation-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-first-row {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    gap: 4px;
}

.conversation-medium-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: #9ca3af;
}

.conversation-item.active .conversation-medium-icon {
    color: #1976d2;
}

.conversation-customer-name {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.conversation-item.active .conversation-customer-name {
    color: #1565c0;
    font-weight: 600;
}

.conversation-second-row {
    display: flex;
    align-items: center;
    font-size: 10px;
    color: #6b7280;
    gap: 3px;
    line-height: 1.2;
}

.conversation-item.active .conversation-second-row {
    color: #1976d2;
}

.conversation-number {
    font-weight: 500;
    font-family: monospace;
    font-size: 9px;
}

.conversation-dot {
    width: 2px;
    height: 2px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.6;
    flex-shrink: 0;
}

.conversation-time {
    white-space: nowrap;
    font-weight: 400;
    font-size: 9px;
}

.conversation-remove {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.conversation-item:hover .conversation-remove {
    opacity: 1;
}

.conversation-remove:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

.conversation-remove:active {
    transform: scale(0.95);
}

.conversation-item.active .conversation-remove {
    display: none;
}

.conversation-remove svg {
    width: 10px;
    height: 10px;
}

/* Empty state */
.conversations-empty {
    padding: 15px;
    text-align: center;
    color: #6b7280;
    font-size: 11px;
    font-style: italic;
}

/* Loading state */
.conversation-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.conversation-item.loading .conversation-avatar {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Animation for removal */
.conversation-item.removing {
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Dark mode adjustments */
.dm .conversations-widget-title {
    color: #f0f0f0;
}

.dm .conversation-item:hover {
    background: #374080;
}

.dm .conversation-item.active {
    background: #2a3663;
    border-left-color: #64b5f6;
}

.dm .conversation-item.active:hover {
    background: #374080;
}

.dm .conversation-avatar {
    background: #4a5085;
    border-color: #374080;
}

.dm .conversation-avatar.active {
    background: #64b5f6;
    border-color: #42a5f5;
}

.dm .conversation-avatar-text {
    color: #b8b8b8;
}

.dm .conversation-avatar.active .conversation-avatar-text {
    color: #1565c0;
}

.dm .conversation-customer-name {
    color: #f0f0f0;
}

.dm .conversation-item.active .conversation-customer-name {
    color: #90caf9;
}

.dm .conversation-second-row {
    color: #9ca3af;
}

.dm .conversation-item.active .conversation-second-row {
    color: #81c784;
}

.dm .conversation-medium-icon {
    color: #9ca3af;
}

.dm .conversation-item.active .conversation-medium-icon {
    color: #81c784;
}

.dm .conversations-empty {
    color: #9ca3af;
}

/* Responsive design */
@media (max-width: 768px) {
    .conversations-widget {
        margin-bottom: 10px;
    }
    
    .conversations-widget-header {
        padding: 6px 10px;
    }
    
    .conversation-item {
        padding: 6px 10px;
    }
    
    .conversation-item.active {
        padding-left: 7px;
    }
    
    .conversation-avatar {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }
    
    .conversation-avatar-text {
        font-size: 10px;
    }
    
    .conversation-customer-name {
        font-size: 11px;
    }
    
    .conversation-second-row {
        font-size: 9px;
    }
    
    .conversation-remove {
        top: 4px;
        right: 6px;
        width: 14px;
        height: 14px;
    }
}

.sidebar-section .conversations-widget {
    margin: 5px 0;
}

.sidebar-section-compact .conversations-widget {
    margin: 0;
}

.conversations-widget + .sidebar-buttons {
    margin-top: 10px;
}

.conversations-widget .conversations-widget-title {
    font-size: medium;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (prefers-contrast: high) {
    .conversation-item {
        border: 1px solid #000;
        margin-bottom: 1px;
    }
    
    .conversation-item.active {
        border: 2px solid #2196f3;
    }
    
    .conversation-remove:hover {
        border: 1px solid #fff;
    }
}

/* Focus states for accessibility */
.conversation-item:focus,
.conversation-remove:focus {
    outline: 2px solid #2196f3;
    outline-offset: 2px;
}

/* Ensure text remains readable */
.conversation-customer-name,
.conversation-number,
.conversation-time {
    user-select: none;
}

.conversation-item {
    border-radius: 0;
    font-family: inherit;
}

.conversation-item:hover {
    text-decoration: none;
}

.conversation-item[data-status-changed] {
    animation: statusHighlight 2s ease-out;
}

@keyframes statusHighlight {
    0% {
        background-color: #e3f2fd;
    }
    100% {
        background-color: transparent;
    }
}